Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
a9343acc
Commit
a9343acc
authored
Jun 25, 2016
by
Davis King
Browse files
Changed code so the validation listing file doesn't have to be in the imagenet
root folder.
parent
4bed64ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
examples/dnn_imagenet_train_ex.cpp
examples/dnn_imagenet_train_ex.cpp
+3
-3
No files found.
examples/dnn_imagenet_train_ex.cpp
View file @
a9343acc
...
...
@@ -161,6 +161,7 @@ std::vector<image_info> get_imagenet_train_listing(
}
std
::
vector
<
image_info
>
get_imagenet_val_listing
(
const
std
::
string
&
imagenet_root_dir
,
const
std
::
string
&
validation_images_file
)
{
...
...
@@ -169,10 +170,9 @@ std::vector<image_info> get_imagenet_val_listing(
std
::
vector
<
image_info
>
results
;
image_info
temp
;
temp
.
numeric_label
=
-
1
;
string
path
=
get_parent_directory
(
file
(
validation_images_file
));
while
(
fin
>>
label
>>
filename
)
{
temp
.
filename
=
path
+
"/"
+
filename
;
temp
.
filename
=
imagenet_root_dir
+
"/"
+
filename
;
if
(
!
file_exists
(
temp
.
filename
))
{
cerr
<<
"file doesn't exist! "
<<
temp
.
filename
<<
endl
;
...
...
@@ -309,7 +309,7 @@ int main(int argc, char** argv) try
int
num_wrong_top1
=
0
;
dlib
::
rand
rnd
(
time
(
0
));
// loop over all the imagenet validation images
for
(
auto
l
:
get_imagenet_val_listing
(
argv
[
2
]))
for
(
auto
l
:
get_imagenet_val_listing
(
argv
[
1
],
argv
[
2
]))
{
dlib
::
array
<
matrix
<
rgb_pixel
>>
images
;
matrix
<
rgb_pixel
>
img
;
...
...
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