Browse Source

fix yolact color array index out of bound bug (#2136)

tags/20201208
Zhuo Zhang GitHub 5 years ago
parent
commit
8d56a62d5f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 82 additions and 20 deletions
  1. +82
    -20
      examples/yolact.cpp

+ 82
- 20
examples/yolact.cpp View File

@@ -369,26 +369,88 @@ static void draw_objects(const cv::Mat& bgr, const std::vector<Object>& objects)
"scissors", "teddy bear", "hair drier", "toothbrush"
};

static const unsigned char colors[19][3] = {
{244, 67, 54},
{233, 30, 99},
{156, 39, 176},
{103, 58, 183},
{63, 81, 181},
{33, 150, 243},
{3, 169, 244},
{0, 188, 212},
{0, 150, 136},
{76, 175, 80},
{139, 195, 74},
{205, 220, 57},
{255, 235, 59},
{255, 193, 7},
{255, 152, 0},
{255, 87, 34},
{121, 85, 72},
{158, 158, 158},
{96, 125, 139}
static const unsigned char colors[81][3] = {
{56, 0, 255},
{226, 255, 0},
{0, 94, 255},
{0, 37, 255},
{0, 255, 94},
{255, 226, 0},
{0, 18, 255},
{255, 151, 0},
{170, 0, 255},
{0, 255, 56},
{255, 0, 75},
{0, 75, 255},
{0, 255, 169},
{255, 0, 207},
{75, 255, 0},
{207, 0, 255},
{37, 0, 255},
{0, 207, 255},
{94, 0, 255},
{0, 255, 113},
{255, 18, 0},
{255, 0, 56},
{18, 0, 255},
{0, 255, 226},
{170, 255, 0},
{255, 0, 245},
{151, 255, 0},
{132, 255, 0},
{75, 0, 255},
{151, 0, 255},
{0, 151, 255},
{132, 0, 255},
{0, 255, 245},
{255, 132, 0},
{226, 0, 255},
{255, 37, 0},
{207, 255, 0},
{0, 255, 207},
{94, 255, 0},
{0, 226, 255},
{56, 255, 0},
{255, 94, 0},
{255, 113, 0},
{0, 132, 255},
{255, 0, 132},
{255, 170, 0},
{255, 0, 188},
{113, 255, 0},
{245, 0, 255},
{113, 0, 255},
{255, 188, 0},
{0, 113, 255},
{255, 0, 0},
{0, 56, 255},
{255, 0, 113},
{0, 255, 188},
{255, 0, 94},
{255, 0, 18},
{18, 255, 0},
{0, 255, 132},
{0, 188, 255},
{0, 245, 255},
{0, 169, 255},
{37, 255, 0},
{255, 0, 151},
{188, 0, 255},
{0, 255, 37},
{0, 255, 0},
{255, 0, 170},
{255, 0, 37},
{255, 75, 0},
{0, 0, 255},
{255, 207, 0},
{255, 0, 226},
{255, 245, 0},
{188, 255, 0},
{0, 255, 18},
{0, 255, 75},
{0, 255, 151},
{255, 56, 0},
{245, 255, 0}
};

cv::Mat image = bgr.clone();


Loading…
Cancel
Save