libeblearntools
|
#include <pascal_dataset.h>
Public Member Functions | |
pascal_dataset (const char *name, const char *inroot=NULL, bool ignore_diff=true, bool ignore_trunc=false, bool ignore_occluded=false, const char *annotations=NULL, const char *ignore_path=NULL, bool ignore_bbox=false) | |
virtual | ~pascal_dataset () |
Destructor. | |
virtual bool | extract () |
Extract data from files into dataset. | |
virtual void | extract_statistics () |
Extracts statistics about dataset into outdir/stats.csv. | |
virtual void | set_min_aspect_ratio (float minar) |
virtual void | set_max_aspect_ratio (float maxar) |
virtual void | set_minborders (idxdim &d) |
virtual void | set_max_jitter_match (float match) |
Protected Member Functions | |
virtual void | compute_random_jitter () |
virtual void | remove_jitter_matches (const std::vector< object * > &objs, uint iobj, float max_match) |
virtual void | write_statistics (string &xml, ofstream &fp) |
Write statistics about frame 'xml' into stream 'fp'. | |
Protected Attributes | |
std::vector< object * > | objects |
A vector of all current objects. | |
uint | iobj |
The 'boxes' index of current box in current image. | |
bool | ignore_difficult |
ignore difficult or not | |
bool | ignore_bbox |
Use entire image instead of bbox. | |
intg | total_difficult |
total number of difficult samples | |
bool | ignore_truncated |
ignore truncated or not | |
intg | total_truncated |
total number of truncated samples | |
bool | ignore_occluded |
ignore occluded or not | |
intg | total_occluded |
total number of occluded samples | |
intg | total_ignored |
total ignore any catergory | |
float | min_aspect_ratio |
float | max_aspect_ratio |
idxdim | minborders |
idxdim | indims |
uint | input_height |
uint | input_width |
string | annroot |
directory of annotation xml files | |
string | imgroot |
directory of images | |
string | ignore_root |
directory of ignored annotatiosn | |
float | max_jitter_match |
< Vector of possible jitters. |
The pascal_dataset class allows to extract a dataset of type PASCAL from sample files and compile all samples into one dataset matrix, formatted for learning. It derives from the dataset class, reimplementing only PASCAL specifics, such as reading xml files, etc.
ebl::pascal_dataset< Tdata >::pascal_dataset | ( | const char * | name, |
const char * | inroot = NULL , |
||
bool | ignore_diff = true , |
||
bool | ignore_trunc = false , |
||
bool | ignore_occluded = false , |
||
const char * | annotations = NULL , |
||
const char * | ignore_path = NULL , |
||
bool | ignore_bbox = false |
||
) |
Initialize the dataset's name and other internal variables, but does not allocate data matrices, user must call alloc for that effect. outdims are the target output dimensions of each sample. inroot is the root directory from which we extract data. ignore_diff ignores difficult objects if true.
ignore_path | The root of boxes to be ignored. Filenames must correspond to original boxes to be used. |
void ebl::pascal_dataset< Tdata >::compute_random_jitter | ( | ) | [protected, virtual] |
Fill internal 'random_jitter' std::vector with all possible jitters in random order.
Reimplemented from ebl::dataset< Tdata >.
void ebl::pascal_dataset< Tdata >::remove_jitter_matches | ( | const std::vector< object * > & | objs, |
uint | iobj, | ||
float | max_match | ||
) | [protected, virtual] |
Remove all jitters in internal vector 'random_jitter' for which the jitter box at index 'ibox' in 'boxes' match all other 'boxes' by more than 'max_match'.
void ebl::pascal_dataset< Tdata >::set_max_aspect_ratio | ( | float | maxar | ) | [virtual] |
Set the maximum aspect ratio (width/height and between 0.0 and 1.0) for a sample to be extracted.
void ebl::pascal_dataset< Tdata >::set_max_jitter_match | ( | float | match | ) | [virtual] |
Set the maximum match between a jittered rect and another object in the same image, beyond which the jitter is ignored.
void ebl::pascal_dataset< Tdata >::set_min_aspect_ratio | ( | float | minar | ) | [virtual] |
Set the minimum aspect ratio (width/height and between 0.0 and 1.0) for a sample to be extracted.
void ebl::pascal_dataset< Tdata >::set_minborders | ( | idxdim & | d | ) | [virtual] |
Set the minimum distances to image borders below which bounding boxes will be rejected.
float ebl::pascal_dataset< Tdata >::max_jitter_match [protected] |
< Vector of possible jitters.
Maximum match of jitter rect with neighbors.