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
45d047de
Commit
45d047de
authored
Feb 09, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor cleanup
parent
57ca3e54
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
dnn_metric_learning_on_images_ex.cpp
examples/dnn_metric_learning_on_images_ex.cpp
+7
-6
No files found.
examples/dnn_metric_learning_on_images_ex.cpp
View file @
45d047de
...
...
@@ -14,9 +14,10 @@
space it's very easy to do face recognition with some kind of k-nearest
neighbor classifier.
In this example we will use the ResNet-34 network from the dnn_imagenet_ex.cpp
example to learn to map images into some vector space where pictures of
the same person are close and pictures of different people are far apart.
In this example we will use a version of the ResNet network from the
dnn_imagenet_ex.cpp example to learn to map images into some vector space where
pictures of the same person are close and pictures of different people are far
apart.
You might want to read the simpler introduction to the deep metric learning
API, dnn_metric_learning_ex.cpp, before reading this example. You should
...
...
@@ -112,7 +113,7 @@ void load_mini_batch (
}
}
// You might want to do some data augmentation at this point. Here we
s
o some simple
// You might want to do some data augmentation at this point. Here we
d
o some simple
// color augmentation.
for
(
auto
&&
crop
:
images
)
disturb_colors
(
crop
,
rnd
);
...
...
@@ -173,7 +174,7 @@ using net_type = loss_metric<fc_no_bias<128,avg_pool_everything<
level3
<
level4
<
max_pool
<
3
,
3
,
2
,
2
,
relu
<
bn_con
<
con
<
32
,
7
,
7
,
2
,
2
,
input_rgb_image
_sized
<
150
>
input_rgb_image
>>>>>>>>>>>>
;
// testing network type (replaced batch normalization with fixed affine transforms)
...
...
@@ -184,7 +185,7 @@ using anet_type = loss_metric<fc_no_bias<128,avg_pool_everything<
alevel3
<
alevel4
<
max_pool
<
3
,
3
,
2
,
2
,
relu
<
affine
<
con
<
32
,
7
,
7
,
2
,
2
,
input_rgb_image
_sized
<
150
>
input_rgb_image
>>>>>>>>>>>>
;
// ----------------------------------------------------------------------------------------
...
...
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