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
1c664eea
Commit
1c664eea
authored
Oct 25, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the metric learning example do image jittering.
parent
369f2b32
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
dnn_face_recognition_ex.cpp
examples/dnn_face_recognition_ex.cpp
+2
-3
dnn_metric_learning_on_images_ex.cpp
examples/dnn_metric_learning_on_images_ex.cpp
+5
-0
No files found.
examples/dnn_face_recognition_ex.cpp
View file @
1c664eea
...
...
@@ -40,9 +40,8 @@ using namespace std;
// The dlib_face_recognition_resnet_model_v1 model used by this example was trained using
// essentially the code shown in dnn_metric_learning_on_images_ex.cpp except the
// mini-batches were made larger (35x15 instead of 5x5), the iterations without progress
// was set to 10000, dlib::jitter_image() was used during training, and the training
// dataset consisted of about 3 million images instead of 55. Also, the input layer was
// locked to images of size 150.
// was set to 10000, and the training dataset consisted of about 3 million images instead of
// 55. Also, the input layer was locked to images of size 150.
template
<
template
<
int
,
template
<
typename
>
class
,
int
,
typename
>
class
block
,
int
N
,
template
<
typename
>
class
BN
,
typename
SUBNET
>
using
residual
=
add_prev1
<
block
<
N
,
BN
,
1
,
tag1
<
SUBNET
>>>
;
...
...
examples/dnn_metric_learning_on_images_ex.cpp
View file @
1c664eea
...
...
@@ -116,7 +116,12 @@ void load_mini_batch (
// You might want to do some data augmentation at this point. Here we do some simple
// color augmentation.
for
(
auto
&&
crop
:
images
)
{
disturb_colors
(
crop
,
rnd
);
// Jitter most crops
if
(
rnd
.
get_random_double
()
>
0.1
)
crop
=
jitter_image
(
crop
,
rnd
);
}
// All the images going into a mini-batch have to be the same size. And really, all
...
...
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