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
91c63155
Commit
91c63155
authored
Jun 19, 2011
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Further simplified initial image selection.
parent
991cb97a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
main.cpp
tools/imglab/src/main.cpp
+11
-10
No files found.
tools/imglab/src/main.cpp
View file @
91c63155
...
@@ -409,15 +409,13 @@ int main(int argc, char** argv)
...
@@ -409,15 +409,13 @@ int main(int argc, char** argv)
parser
.
add_option
(
"h"
,
"Displays this information."
);
parser
.
add_option
(
"h"
,
"Displays this information."
);
parser
.
add_option
(
"c"
,
"Create an XML file named <arg> listing a set of images."
,
1
);
parser
.
add_option
(
"c"
,
"Create an XML file named <arg> listing a set of images."
,
1
);
parser
.
add_option
(
"d"
,
"Include all images files in directory <arg> in the new image file list."
,
1
);
parser
.
add_option
(
"r"
,
"Search directories recursively for images."
);
parser
.
add_option
(
"r"
,
"Search directories recursively for images."
);
parser
.
parse
(
argc
,
argv
);
parser
.
parse
(
argc
,
argv
);
const
char
*
singles
[]
=
{
"h"
,
"c"
,
"r"
};
const
char
*
singles
[]
=
{
"h"
,
"c"
,
"r"
};
parser
.
check_one_time_options
(
singles
);
parser
.
check_one_time_options
(
singles
);
parser
.
check_sub_option
(
"c"
,
"d"
);
parser
.
check_sub_option
(
"c"
,
"r"
);
parser
.
check_sub_option
(
"d"
,
"r"
);
if
(
parser
.
option
(
"h"
))
if
(
parser
.
option
(
"h"
))
{
{
...
@@ -437,23 +435,25 @@ int main(int argc, char** argv)
...
@@ -437,23 +435,25 @@ int main(int argc, char** argv)
make_empty_file
(
filename
);
make_empty_file
(
filename
);
const
std
::
string
parent_dir
=
get_parent_directory
(
file
(
filename
)).
full_name
();
const
std
::
string
parent_dir
=
get_parent_directory
(
file
(
filename
)).
full_name
();
unsigned
long
depth
=
0
;
if
(
parser
.
option
(
"r"
))
depth
=
30
;
image_dataset_metadata
metadata
;
image_dataset_metadata
metadata
;
metadata
.
name
=
"imglab dataset"
;
metadata
.
name
=
"imglab dataset"
;
metadata
.
comment
=
"Created by imglab tool."
;
metadata
.
comment
=
"Created by imglab tool."
;
for
(
unsigned
long
i
=
0
;
i
<
parser
.
number_of_arguments
();
++
i
)
for
(
unsigned
long
i
=
0
;
i
<
parser
.
number_of_arguments
();
++
i
)
{
try
{
{
const
string
temp
=
strip_path
(
file
(
parser
[
i
]).
full_name
(),
parent_dir
);
const
string
temp
=
strip_path
(
file
(
parser
[
i
]).
full_name
(),
parent_dir
);
metadata
.
images
.
push_back
(
image
(
temp
));
metadata
.
images
.
push_back
(
image
(
temp
));
}
}
catch
(
dlib
::
file
::
file_not_found
&
)
for
(
unsigned
long
i
=
0
;
i
<
parser
.
option
(
"d"
).
count
();
++
i
)
{
{
unsigned
long
depth
=
0
;
// then parser[i] should be a directory
if
(
parser
.
option
(
"r"
))
depth
=
30
;
std
::
vector
<
file
>
files
=
get_files_in_directory_tree
(
parser
.
option
(
"d"
).
argument
(
0
,
i
)
,
std
::
vector
<
file
>
files
=
get_files_in_directory_tree
(
parser
[
i
]
,
match_endings
(
".png .PNG .jpeg .JPEG .jpg .JPG .bmp .BMP .dng .DNG"
),
match_endings
(
".png .PNG .jpeg .JPEG .jpg .JPG .bmp .BMP .dng .DNG"
),
depth
);
depth
);
sort
(
files
.
begin
(),
files
.
end
());
sort
(
files
.
begin
(),
files
.
end
());
...
@@ -463,6 +463,7 @@ int main(int argc, char** argv)
...
@@ -463,6 +463,7 @@ int main(int argc, char** argv)
metadata
.
images
.
push_back
(
image
(
strip_path
(
files
[
j
].
full_name
(),
parent_dir
)));
metadata
.
images
.
push_back
(
image
(
strip_path
(
files
[
j
].
full_name
(),
parent_dir
)));
}
}
}
}
}
save_image_dataset_metadata
(
metadata
,
filename
);
save_image_dataset_metadata
(
metadata
,
filename
);
...
...
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