-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathImageDatabase.h
More file actions
69 lines (54 loc) · 1.88 KB
/
ImageDatabase.h
File metadata and controls
69 lines (54 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef IMAGE_DATABASE_H
#define IMAGE_DATABASE_H
#include "Common.h"
#include "Detection.h"
using namespace std;
//! Pascal Image Database Class
/*!
This class stores the list of images provided in the PASCAL VOC format.
*/
class ImageDatabase
{
private:
vector<string> _filenames;
vector<vector<Detection> > _detections;
string _dbFilename;
string _category;
int _positivesCount;
int _negativesCount;
vector<float> _labels;
public:
//! Constructor
ImageDatabase();
//! Constructor
/*!
\param dbFilename Path where the input image list is located.
\param category Class that we want to train.
*/
ImageDatabase(const string &dbFilename, const string category);
ImageDatabase(const vector<vector<Detection> > &dets, const vector<string> &fnames);
//! Load a database from file.
/*!
\dbFilename Path where the input image list is located.
*/
void load(const string &dbFilename);
//! Save a database to file.
/*!
\dbFilename Path where the input image list is located.
*/
void save(const string &dbFilename);
// Accessors
const vector<vector<Detection> > &getDetections() const { return _detections; }
const vector<string> &getFilenames() const { return _filenames; }
// Info about the database
int getPositivesCount() const { return _positivesCount; }
int getNegativesCount() const { return _negativesCount; }
int getUnlabeledCount() const { return _labels.size() - _positivesCount - _negativesCount; }
int getSize() const { return _detections.size(); }
string getDatabaseFilename() const { return _dbFilename; }
// Getting the ground truth from the annotations
vector<Detection> getGroundTruth(string imageName);
};
// Prints information about the dataset
ostream &operator<<(ostream &s, const ImageDatabase &db);
#endif // IMAGE_DATABASE_H