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
aec695fc
Commit
aec695fc
authored
Aug 27, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup
parent
f6e23cab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
37 deletions
+2
-37
dnn_mmod_train_find_cars_ex.cpp
examples/dnn_mmod_train_find_cars_ex.cpp
+2
-37
No files found.
examples/dnn_mmod_train_find_cars_ex.cpp
View file @
aec695fc
...
...
@@ -72,41 +72,6 @@ int ignore_overlapped_boxes(
// ----------------------------------------------------------------------------------------
template
<
typename
pyramid_type
,
typename
image_array_type
>
void
upsample_image_dataset_limit
(
image_array_type
&
images
,
std
::
vector
<
std
::
vector
<
mmod_rect
>>&
objects
)
{
// make sure requires clause is not broken
DLIB_ASSERT
(
images
.
size
()
==
objects
.
size
(),
"
\t
void upsample_image_dataset_limit()"
<<
"
\n\t
Invalid inputs were given to this function."
<<
"
\n\t
images.size(): "
<<
images
.
size
()
<<
"
\n\t
objects.size(): "
<<
objects
.
size
()
);
typename
image_array_type
::
value_type
temp
;
pyramid_type
pyr
;
for
(
unsigned
long
i
=
0
;
i
<
images
.
size
();
++
i
)
{
if
(
images
[
i
].
size
()
<
1800
*
1800
)
{
pyramid_up
(
images
[
i
],
temp
,
pyr
);
swap
(
temp
,
images
[
i
]);
for
(
unsigned
long
j
=
0
;
j
<
objects
[
i
].
size
();
++
j
)
{
objects
[
i
][
j
].
rect
=
pyr
.
rect_up
(
objects
[
i
][
j
].
rect
);
}
}
}
}
// ----------------------------------------------------------------------------------------
int
main
(
int
argc
,
char
**
argv
)
try
{
if
(
argc
!=
2
)
...
...
@@ -307,13 +272,13 @@ int main(int argc, char** argv) try
cout
<<
"
\n
sync_filename: "
<<
sync_filename
<<
endl
;
cout
<<
"num training images: "
<<
images_train
.
size
()
<<
endl
;
cout
<<
"training results: "
<<
test_object_detection_function
(
net
,
images_train
,
boxes_train
,
test_box_overlap
(),
0
,
options
.
overlaps_ignore
);
upsample_image_dataset
_limit
<
pyramid_down
<
2
>>
(
images_train
,
boxes_train
);
upsample_image_dataset
<
pyramid_down
<
2
>>
(
images_train
,
boxes_train
,
1800
*
1800
);
cout
<<
"training upsampled results: "
<<
test_object_detection_function
(
net
,
images_train
,
boxes_train
,
test_box_overlap
(),
0
,
options
.
overlaps_ignore
);
cout
<<
"num testing images: "
<<
images_test
.
size
()
<<
endl
;
cout
<<
"testing results: "
<<
test_object_detection_function
(
net
,
images_test
,
boxes_test
,
test_box_overlap
(),
0
,
options
.
overlaps_ignore
);
upsample_image_dataset
_limit
<
pyramid_down
<
2
>>
(
images_test
,
boxes_test
);
upsample_image_dataset
<
pyramid_down
<
2
>>
(
images_test
,
boxes_test
,
1800
*
1800
);
cout
<<
"testing upsampled results: "
<<
test_object_detection_function
(
net
,
images_test
,
boxes_test
,
test_box_overlap
(),
0
,
options
.
overlaps_ignore
);
/*
...
...
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