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
dc6a82cb
Commit
dc6a82cb
authored
Mar 20, 2012
by
Davis King
Browse files
Added some comments
parent
9a86f1fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
dlib/data_io/image_dataset_metadata.h
dlib/data_io/image_dataset_metadata.h
+55
-0
No files found.
dlib/data_io/image_dataset_metadata.h
View file @
dc6a82cb
...
@@ -13,8 +13,20 @@ namespace dlib
...
@@ -13,8 +13,20 @@ namespace dlib
{
{
namespace
image_dataset_metadata
namespace
image_dataset_metadata
{
{
// ------------------------------------------------------------------------------------
struct
box
struct
box
{
{
/*!
WHAT THIS OBJECT REPRESENTS
This object represents an annotated rectangular area of an image.
It is typically used to mark the location of an object such as a
person, car, etc.
The main variable of interest is rect. It gives the location of
the box. All the other variables are optional.
!*/
box
(
box
(
)
:
)
:
head
(
-
0xFFFF
,
-
0xFFFF
),
head
(
-
0xFFFF
,
-
0xFFFF
),
...
@@ -33,11 +45,27 @@ namespace dlib
...
@@ -33,11 +45,27 @@ namespace dlib
bool
occluded
;
bool
occluded
;
bool
has_head
()
const
{
return
head
!=
point
(
-
0xFFFF
,
-
0xFFFF
);
}
bool
has_head
()
const
{
return
head
!=
point
(
-
0xFFFF
,
-
0xFFFF
);
}
/*!
ensures
- returns true if head metadata is present and false otherwise.
!*/
bool
has_label
()
const
{
return
label
.
size
()
!=
0
;
}
bool
has_label
()
const
{
return
label
.
size
()
!=
0
;
}
/*!
ensures
- returns true if label metadata is present and false otherwise.
!*/
};
};
// ------------------------------------------------------------------------------------
struct
image
struct
image
{
{
/*!
WHAT THIS OBJECT REPRESENTS
This object represents an annotated image.
!*/
image
()
{}
image
()
{}
image
(
const
std
::
string
&
f
)
:
filename
(
f
)
{}
image
(
const
std
::
string
&
f
)
:
filename
(
f
)
{}
...
@@ -45,8 +73,16 @@ namespace dlib
...
@@ -45,8 +73,16 @@ namespace dlib
std
::
vector
<
box
>
boxes
;
std
::
vector
<
box
>
boxes
;
};
};
// ------------------------------------------------------------------------------------
struct
dataset
struct
dataset
{
{
/*!
WHAT THIS OBJECT REPRESENTS
This object represents a labeled set of images. In particular, it
contains the filename for each image as well as annotated boxes.
!*/
std
::
vector
<
image
>
images
;
std
::
vector
<
image
>
images
;
std
::
string
comment
;
std
::
string
comment
;
std
::
string
name
;
std
::
string
name
;
...
@@ -58,6 +94,15 @@ namespace dlib
...
@@ -58,6 +94,15 @@ namespace dlib
const
dataset
&
meta
,
const
dataset
&
meta
,
const
std
::
string
&
filename
const
std
::
string
&
filename
);
);
/*!
ensures
- Writes the contents of the meta object to a file with the given
filename. The file will be in an XML format.
throws
- dlib::error
This exception is thrown if there is an error which prevents
this function from succeeding.
!*/
// ------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------
...
@@ -65,6 +110,16 @@ namespace dlib
...
@@ -65,6 +110,16 @@ namespace dlib
dataset
&
meta
,
dataset
&
meta
,
const
std
::
string
&
filename
const
std
::
string
&
filename
);
);
/*!
ensures
- Attempts to interpret filename as a file containing XML formatted data
as produced by the save_image_dataset_metadata() function. Then
meta is loaded with the contents of the file.
throws
- dlib::error
This exception is thrown if there is an error which prevents
this function from succeeding.
!*/
// ------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------
...
...
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