-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvisualize.h
70 lines (65 loc) · 1.46 KB
/
visualize.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
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
70
#pragma once
#include <VX/vx.h>
#include "mvdeploy_api.h"
#include <vector>
#include "mv_extras_postproc.h"
#include <stdarg.h>
#include <opencv2/opencv.hpp>
#include <opencv/cv.h>
#include <opencv/highgui.h>
static const int colors[20][3] = {
{160,82,45}, // aeroplane
{128,0,0}, // bicycle
{47,79,79}, // bird
{155,140,145}, // boat
{140,155,255}, // bottle
{255,105,180}, // bus
{255,0,0}, // car
{75,0,130}, // cat
{255,140,0}, // chair
{250,128,114}, // cow
{153,50,204}, // diningtable
{130,230,150}, // dog
{0,220,255}, // horse
{0,191,255}, // motorbike
{0,0,255}, // person
{0,255,255}, // potted plant
{107,142,35}, // sheep
{0,128,0}, // sofa
{124,252,0}, // train
{199,21,133} // tvmonitor
};
static const std::string yoloClasses[20] = {
"aeroplane",
"bicycle",
"bird",
"boat",
"bottle",
"bus",
"car",
"cat",
"chair",
"cow",
"dining table",
"dog",
"horse",
"motorbike",
"person",
"potted plant",
"sheep",
"sofa",
"train",
"tvmonitor"
};
class Visualize {
public:
Visualize(float confidence);
~Visualize();
void show(const cv::Mat& img, std::vector<BBox>& Results, int batchSize = 1);
void LegendImage();
private:
const float mConfidence;
const int mColorNum = 20;
const int mWidth = 416;
const int mHeight = 416;
};