Commit ae3cb6b7 authored by Davis King's avatar Davis King

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
......@@ -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
)
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment