-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathannonet_parse_anno_classes.h
39 lines (30 loc) · 1.11 KB
/
annonet_parse_anno_classes.h
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
/*
This example shows how to train a semantic segmentation net using images
annotated in the "anno" program (see https://github.com/reunanen/anno).
Instructions:
1. Use anno to label some data.
2. Build the annonet_train program.
3. Run:
./annonet_train /path/to/anno/data
4. Wait while the network is being trained.
5. Build the annonet_infer example program.
6. Run:
./annonet_infer /path/to/anno/data
*/
#ifndef ANNONET_PARSE_ANNO_CLASSES_H
#define ANNONET_PARSE_ANNO_CLASSES_H
#include <dlib/dnn.h>
// ----------------------------------------------------------------------------------------
struct AnnoClass {
AnnoClass(uint16_t index, const dlib::rgb_alpha_pixel& rgba_label, const std::string& classlabel)
: index(index), rgba_label(rgba_label), classlabel(classlabel)
{}
const uint16_t index = 0;
const dlib::rgb_alpha_pixel rgba_label;
const std::string classlabel;
};
namespace {
dlib::rgb_alpha_pixel rgba_ignore_label(0, 0, 0, 0);
}
std::vector<AnnoClass> parse_anno_classes(const std::string& json);
#endif // ANNONET_PARSE_ANNO_CLASSES_H