Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
a215c494
Commit
a215c494
authored
Sep 29, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing requires clauses and asserts.
parent
d41613d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
random_cropper.h
dlib/image_transforms/random_cropper.h
+3
-1
random_cropper_abstract.h
dlib/image_transforms/random_cropper_abstract.h
+18
-0
No files found.
dlib/image_transforms/random_cropper.h
View file @
a215c494
...
...
@@ -135,6 +135,7 @@ namespace dlib
std
::
vector
<
mmod_rect
>&
crop_rects
)
{
DLIB_CASSERT
(
num_rows
(
img
)
*
num_columns
(
img
)
!=
0
);
chip_details
crop_plan
;
bool
should_flip_crop
;
make_crop_plan
(
img
,
rects
,
crop_plan
,
should_flip_crop
);
...
...
@@ -233,9 +234,10 @@ namespace dlib
template
<
typename
image_type
>
rectangle
make_random_cropping_rect_resnet
(
const
image_type
&
img
const
image_type
&
img
_
)
{
const_image_view
<
image_type
>
img
(
img_
);
// figure out what rectangle we want to crop from the image
double
mins
=
0
.
1
,
maxs
=
0
.
95
;
auto
scale
=
rnd
.
get_double_in_range
(
mins
,
maxs
);
...
...
dlib/image_transforms/random_cropper_abstract.h
View file @
a215c494
...
...
@@ -174,6 +174,11 @@ namespace dlib
/*!
requires
- images.size() == rects.size()
- for all valid i:
- images[i].size() != 0
- array_type is a type with an interface compatible with dlib::array or
std::vector and it must in turn contain image objects that implement the
interface defined in dlib/image_processing/generic_image.h
ensures
- Randomly extracts num_crops chips from images. We also copy the object
metadata for each extracted crop and store it into #crop_rects. In
...
...
@@ -195,6 +200,13 @@ namespace dlib
/*!
requires
- images.size() == rects.size()
- for all valid i:
- images[i].size() != 0
- image_type == an image object that implements the interface defined in
dlib/image_processing/generic_image.h
- array_type is a type with an interface compatible with dlib::array or
std::vector and it must in turn contain image objects that implement the
interface defined in dlib/image_processing/generic_image.h
ensures
- Selects a random image and creates a random crop from it. Specifically,
we pick a random index IDX < images.size() and then execute
...
...
@@ -212,6 +224,12 @@ namespace dlib
std
::
vector
<
mmod_rect
>&
crop_rects
);
/*!
requires
- img.size() != 0
- image_type1 == an image object that implements the interface defined in
dlib/image_processing/generic_image.h
- image_type2 == an image object that implements the interface defined in
dlib/image_processing/generic_image.h
ensures
- Extracts a random crop from img and copies over the mmod_rect objects in
rects to #crop_rects if they are contained inside the crop. Moreover,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment