arunponnusamy / cvlib

A simple, high level, easy to use, open source Computer Vision library for Python.
http://arunponnusamy.com/cvlib/
MIT License
647 stars 127 forks source link

object Detection color #29

Closed T2brozz closed 4 years ago

T2brozz commented 4 years ago

Is there a list with all classes and thier colors? Like, Person -> violet

arunponnusamy commented 4 years ago

Yes @T2brozz. By default, random colors are generated for the 80 object classes. You can send in a list of 80 color values to the draw_bbox function to use that instead of random colors. https://github.com/arunponnusamy/cvlib/blob/master/cvlib/object_detection.py#L34

draw_bbox(img, bbox, labels, confidence, colors=None, write_conf=False)

The list of 80 classes in order can be found here https://github.com/arunponnusamy/object-detection-opencv/raw/master/yolov3.txt . Color values are in (B,G,R) format ranging from 0 to 255. For example (0,255,0) will be green.

T2brozz commented 4 years ago

thank you