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
66bbc515
Commit
66bbc515
authored
Jun 19, 2011
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor code cleanup
parent
78094af4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
28 deletions
+37
-28
main.cpp
tools/imglab/src/main.cpp
+37
-28
No files found.
tools/imglab/src/main.cpp
View file @
66bbc515
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#include <dlib/dir_nav.h>
#include <dlib/dir_nav.h>
typedef
dlib
::
cmd_line_parser
<
char
>::
check_1a_c
parser_type
;
using
namespace
std
;
using
namespace
std
;
using
namespace
dlib
;
using
namespace
dlib
;
...
@@ -46,35 +47,10 @@ void make_empty_file (
...
@@ -46,35 +47,10 @@ void make_empty_file (
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
void
create_new_dataset
(
int
main
(
int
argc
,
char
**
argv
)
const
parser_type
&
parser
)
{
{
try
{
typedef
dlib
::
cmd_line_parser
<
char
>::
check_1a_c
parser_type
;
parser_type
parser
;
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
(
"r"
,
"Search directories recursively for images."
);
parser
.
parse
(
argc
,
argv
);
const
char
*
singles
[]
=
{
"h"
,
"c"
,
"r"
};
parser
.
check_one_time_options
(
singles
);
parser
.
check_sub_option
(
"c"
,
"r"
);
if
(
parser
.
option
(
"h"
))
{
cout
<<
"Usage: imglab [options] <image files/directories or XML file list>
\n
"
;
parser
.
print_options
(
cout
);
cout
<<
endl
<<
endl
;
return
EXIT_SUCCESS
;
}
if
(
parser
.
option
(
"c"
))
{
using
namespace
dlib
::
image_dataset_metadata
;
using
namespace
dlib
::
image_dataset_metadata
;
const
std
::
string
filename
=
parser
.
option
(
"c"
).
argument
();
const
std
::
string
filename
=
parser
.
option
(
"c"
).
argument
();
...
@@ -114,7 +90,38 @@ int main(int argc, char** argv)
...
@@ -114,7 +90,38 @@ int main(int argc, char** argv)
}
}
save_image_dataset_metadata
(
meta
,
filename
);
save_image_dataset_metadata
(
meta
,
filename
);
}
// ----------------------------------------------------------------------------------------
int
main
(
int
argc
,
char
**
argv
)
{
try
{
parser_type
parser
;
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
(
"r"
,
"Search directories recursively for images."
);
parser
.
parse
(
argc
,
argv
);
const
char
*
singles
[]
=
{
"h"
,
"c"
,
"r"
};
parser
.
check_one_time_options
(
singles
);
parser
.
check_sub_option
(
"c"
,
"r"
);
if
(
parser
.
option
(
"h"
))
{
cout
<<
"Usage: imglab [options] <image files/directories or XML file list>
\n
"
;
parser
.
print_options
(
cout
);
cout
<<
endl
<<
endl
;
return
EXIT_SUCCESS
;
}
if
(
parser
.
option
(
"c"
))
{
create_new_dataset
(
parser
);
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
}
}
...
@@ -132,3 +139,5 @@ int main(int argc, char** argv)
...
@@ -132,3 +139,5 @@ int main(int argc, char** argv)
}
}
}
}
// ----------------------------------------------------------------------------------------
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