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
ae3cb6b7
Commit
ae3cb6b7
authored
Sep 03, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made load_image_dataset() more generic. Now it can operate on arrays of images
that use std::vector in addition to dlib::array.
parent
bb7d2ef5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
40 deletions
+42
-40
load_image_dataset.h
dlib/data_io/load_image_dataset.h
+12
-15
load_image_dataset_abstract.h
dlib/data_io/load_image_dataset_abstract.h
+30
-25
No files found.
dlib/data_io/load_image_dataset.h
View file @
ae3cb6b7
...
...
@@ -84,11 +84,10 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template
<
typename
image_type
,
typename
MM
typename
array_type
>
std
::
vector
<
std
::
vector
<
rectangle
>
>
load_image_dataset
(
array
<
image_type
,
MM
>
&
images
,
array
_type
&
images
,
std
::
vector
<
std
::
vector
<
rectangle
>
>&
object_locations
,
const
image_dataset_file
&
source
)
...
...
@@ -109,6 +108,7 @@ namespace dlib
set_current_dir
(
get_parent_directory
(
file
(
source
.
get_filename
())));
typedef
typename
array_type
::
value_type
image_type
;
image_type
img
;
...
...
@@ -167,11 +167,10 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template
<
typename
image_type
,
typename
MM
typename
array_type
>
std
::
vector
<
std
::
vector
<
rectangle
>
>
load_image_dataset
(
array
<
image_type
,
MM
>
&
images
,
array
_type
&
images
,
std
::
vector
<
std
::
vector
<
rectangle
>
>&
object_locations
,
const
std
::
string
&
filename
)
...
...
@@ -184,16 +183,16 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template
<
typename
image_type
,
typename
MM
typename
array_type
>
std
::
vector
<
std
::
vector
<
rectangle
>
>
load_image_dataset
(
array
<
image_type
,
MM
>
&
images
,
array
_type
&
images
,
std
::
vector
<
std
::
vector
<
full_object_detection
>
>&
object_locations
,
const
image_dataset_file
&
source
,
std
::
vector
<
std
::
string
>&
parts_list
)
{
typedef
typename
array_type
::
value_type
image_type
;
parts_list
.
clear
();
images
.
clear
();
object_locations
.
clear
();
...
...
@@ -287,11 +286,10 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template
<
typename
image_type
,
typename
MM
typename
array_type
>
std
::
vector
<
std
::
vector
<
rectangle
>
>
load_image_dataset
(
array
<
image_type
,
MM
>
&
images
,
array
_type
&
images
,
std
::
vector
<
std
::
vector
<
full_object_detection
>
>&
object_locations
,
const
image_dataset_file
&
source
)
...
...
@@ -303,11 +301,10 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template
<
typename
image_type
,
typename
MM
typename
array_type
>
std
::
vector
<
std
::
vector
<
rectangle
>
>
load_image_dataset
(
array
<
image_type
,
MM
>
&
images
,
array
_type
&
images
,
std
::
vector
<
std
::
vector
<
full_object_detection
>
>&
object_locations
,
const
std
::
string
&
filename
)
...
...
dlib/data_io/load_image_dataset_abstract.h
View file @
ae3cb6b7
...
...
@@ -121,18 +121,19 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template
<
typename
image_type
,
typename
MM
typename
array_type
>
std
::
vector
<
std
::
vector
<
rectangle
>
>
load_image_dataset
(
array
<
image_type
,
MM
>
&
images
,
array
_type
&
images
,
std
::
vector
<
std
::
vector
<
rectangle
>
>&
object_locations
,
const
image_dataset_file
&
source
);
/*!
requires
- image_type == is an implementation of array2d/array2d_kernel_abstract.h
- pixel_traits<typename image_type::type> is defined
- array_type == An array of images. This is anything with an interface that
looks like std::vector<some generic image type> where a "generic image" is
anything that implements the generic image interface defined in
dlib/image_processing/generic_image.h.
ensures
- This routine loads the images and their associated object boxes from the
image metadata file indicated by source.get_filename(). This metadata file
...
...
@@ -162,18 +163,19 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template
<
typename
image_type
,
typename
MM
typename
array_type
>
std
::
vector
<
std
::
vector
<
rectangle
>
>
load_image_dataset
(
array
<
image_type
,
MM
>
&
images
,
array
_type
&
images
,
std
::
vector
<
std
::
vector
<
rectangle
>
>&
object_locations
,
const
std
::
string
&
filename
);
/*!
requires
- image_type == is an implementation of array2d/array2d_kernel_abstract.h
- pixel_traits<typename image_type::type> is defined
- array_type == An array of images. This is anything with an interface that
looks like std::vector<some generic image type> where a "generic image" is
anything that implements the generic image interface defined in
dlib/image_processing/generic_image.h.
ensures
- performs: return load_image_dataset(images, object_locations, image_dataset_file(filename));
(i.e. it ignores box labels and therefore loads all the boxes in the dataset)
...
...
@@ -183,19 +185,20 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template
<
typename
image_type
,
typename
MM
typename
array_type
>
std
::
vector
<
std
::
vector
<
rectangle
>
>
load_image_dataset
(
array
<
image_type
,
MM
>
&
images
,
array
_type
&
images
,
std
::
vector
<
std
::
vector
<
full_object_detection
>
>&
object_locations
,
const
image_dataset_file
&
source
,
std
::
vector
<
std
::
string
>&
parts_list
);
/*!
requires
- image_type == is an implementation of array2d/array2d_kernel_abstract.h
- pixel_traits<typename image_type::type> is defined
- array_type == An array of images. This is anything with an interface that
looks like std::vector<some generic image type> where a "generic image" is
anything that implements the generic image interface defined in
dlib/image_processing/generic_image.h.
ensures
- This routine loads the images and their associated object locations from the
image metadata file indicated by source.get_filename(). This metadata file
...
...
@@ -237,18 +240,19 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template
<
typename
image_type
,
typename
MM
typename
array_type
>
std
::
vector
<
std
::
vector
<
rectangle
>
>
load_image_dataset
(
array
<
image_type
,
MM
>
&
images
,
array
_type
&
images
,
std
::
vector
<
std
::
vector
<
full_object_detection
>
>&
object_locations
,
const
image_dataset_file
&
source
);
/*!
requires
- image_type == is an implementation of array2d/array2d_kernel_abstract.h
- pixel_traits<typename image_type::type> is defined
- array_type == An array of images. This is anything with an interface that
looks like std::vector<some generic image type> where a "generic image" is
anything that implements the generic image interface defined in
dlib/image_processing/generic_image.h.
ensures
- performs: return load_image_dataset(images, object_locations, source, parts_list);
(i.e. this function simply calls the above function and discards the output
...
...
@@ -259,18 +263,19 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template
<
typename
image_type
,
typename
MM
typename
array_type
>
std
::
vector
<
std
::
vector
<
rectangle
>
>
load_image_dataset
(
array
<
image_type
,
MM
>
&
images
,
array
_type
&
images
,
std
::
vector
<
std
::
vector
<
full_object_detection
>
>&
object_locations
,
const
std
::
string
&
filename
);
/*!
requires
- image_type == is an implementation of array2d/array2d_kernel_abstract.h
- pixel_traits<typename image_type::type> is defined
- array_type == An array of images. This is anything with an interface that
looks like std::vector<some generic image type> where a "generic image" is
anything that implements the generic image interface defined in
dlib/image_processing/generic_image.h.
ensures
- performs: return load_image_dataset(images, object_locations, image_dataset_file(filename));
(i.e. it ignores box labels and therefore loads all the boxes in the dataset)
...
...
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