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
cd5147b2
Commit
cd5147b2
authored
Apr 13, 2013
by
Davis King
Browse files
Made both versions of load_image_dataset() support the skip_empty_images option
parent
8bde794c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
dlib/data_io/load_image_dataset.h
dlib/data_io/load_image_dataset.h
+10
-4
dlib/data_io/load_image_dataset_abstract.h
dlib/data_io/load_image_dataset_abstract.h
+7
-2
No files found.
dlib/data_io/load_image_dataset.h
View file @
cd5147b2
...
...
@@ -97,7 +97,8 @@ namespace dlib
array
<
image_type
,
MM
>&
images
,
std
::
vector
<
std
::
vector
<
full_object_detection
>
>&
object_locations
,
const
std
::
string
&
filename
,
const
std
::
string
&
label
const
std
::
string
&
label
,
bool
skip_empty_images
=
false
)
{
images
.
clear
();
...
...
@@ -144,11 +145,10 @@ namespace dlib
ret_parts_list
.
push_back
(
*
i
);
}
image
s
.
resize
(
data
.
images
.
size
())
;
image
_type
img
;
std
::
vector
<
full_object_detection
>
object_dets
;
for
(
unsigned
long
i
=
0
;
i
<
data
.
images
.
size
();
++
i
)
{
load_image
(
images
[
i
],
data
.
images
[
i
].
filename
);
object_dets
.
clear
();
for
(
unsigned
long
j
=
0
;
j
<
data
.
images
[
i
].
boxes
.
size
();
++
j
)
{
...
...
@@ -167,7 +167,13 @@ namespace dlib
object_dets
.
push_back
(
full_object_detection
(
data
.
images
[
i
].
boxes
[
j
].
rect
,
partlist
));
}
}
object_locations
.
push_back
(
object_dets
);
if
(
!
skip_empty_images
||
object_dets
.
size
()
!=
0
)
{
object_locations
.
push_back
(
object_dets
);
load_image
(
img
,
data
.
images
[
i
].
filename
);
images
.
push_back
(
img
);
}
}
set_current_dir
(
old_working_dir
);
...
...
dlib/data_io/load_image_dataset_abstract.h
View file @
cd5147b2
...
...
@@ -82,7 +82,8 @@ namespace dlib
array
<
image_type
,
MM
>&
images
,
std
::
vector
<
std
::
vector
<
full_object_detection
>
>&
object_locations
,
const
std
::
string
&
filename
,
const
std
::
string
&
label
const
std
::
string
&
label
,
bool
skip_empty_images
=
false
);
/*!
requires
...
...
@@ -95,7 +96,8 @@ namespace dlib
- The difference between this function and the version of load_image_dataset()
defined above is that this version will also load object part information and
thus fully populates the full_object_detection objects.
- #images.size() == the number of images in the metadata file
- #images.size() == The number of images loaded from the metadata file. This
is all the images listed in the file unless skip_empty_images is set to true.
- #images.size() == #object_locations.size()
- This routine is capable of loading any image format which can be read
by the load_image() routine.
...
...
@@ -105,6 +107,9 @@ namespace dlib
- #images[i] == a copy of the ith image from the dataset.
- #object_locations[i] == a vector of all the object detections associated
with #images[i].
- if (skip_empty_images == true) then
- #object_locations[i].size() != 0
(i.e. only images with detection boxes in them will be loaded.)
- for all valid j:
- #object_locations[i][j].num_parts() == RETURNED_PARTS.size()
- for all valid k:
...
...
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