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
38ca3c32
Commit
38ca3c32
authored
Sep 05, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a method to set the random_cropper's random seed.
parent
8c7f36ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
random_cropper.h
dlib/image_transforms/random_cropper.h
+7
-2
random_cropper_abstract.h
dlib/image_transforms/random_cropper_abstract.h
+8
-0
No files found.
dlib/image_transforms/random_cropper.h
View file @
38ca3c32
...
...
@@ -21,8 +21,15 @@ namespace dlib
double
min_object_height
=
0
.
25
;
// cropped object will be at least this fraction of the height of the image.
double
max_object_height
=
0
.
7
;
// cropped object will be at most this fraction of the height of the image.
double
background_crops_fraction
=
0
.
1
;
std
::
mutex
rnd_mutex
;
dlib
::
rand
rnd
;
public
:
void
set_seed
(
time_t
seed
)
{
rnd
=
dlib
::
rand
(
seed
);
}
double
get_background_crops_fraction
(
)
const
{
return
background_crops_fraction
;
}
...
...
@@ -241,8 +248,6 @@ namespace dlib
}
std
::
mutex
rnd_mutex
;
dlib
::
rand
rnd
;
};
...
...
dlib/image_transforms/random_cropper_abstract.h
View file @
38ca3c32
...
...
@@ -40,6 +40,14 @@ namespace dlib
- #get_background_crops_fraction() == 0.1
!*/
void
set_seed
(
time_t
seed
);
/*!
ensures
- Seeds the internal random number generator with the given seed.
!*/
double
get_background_crops_fraction
(
)
const
;
/*!
...
...
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