Then I found that in chainercv/visualizations/vis_bbox.py the instance_colors didn't be sorted by score. I rewrote the sorted part like folowing and the color works right.
if sort_by_score and score is not None:
order = np.argsort(score)
bbox = bbox[order]
score = score[order]
# Sorted the instance_colors
instance_colors = instance_colors[order]
if label is not None:
label = label[order]
I tried to use the
visualizations.vis_bbox()
, but the colors and the labels did not correspond.Then I found that in chainercv/visualizations/vis_bbox.py the
instance_colors
didn't be sorted by score. I rewrote the sorted part like folowing and the color works right.