0ssamaak0 / DLTA-AI

Data Labeling, Tracking and Annotation with AI
GNU General Public License v3.0
314 stars 39 forks source link

Create a unified ColorPalette Generator #72

Closed 0ssamaak0 closed 9 months ago

0ssamaak0 commented 10 months ago

The following implementation of coloring the masks and the bboxes is very bad, it's based on a hardcoded color palette copied and pasted across many files such as intelligence.py , mathOps.py, visualizations,py etc

The current color palette is

color_palette = [(75, 25, 230),
                 (75, 180, 60),
                 (25, 225, 255),
                 (200, 130, 0),
                 (49, 130, 245),
                 (180, 30, 145),
                 (240, 240, 70),
                 (230, 50, 240),
                 (60, 245, 210),
                 (190, 190, 250),
                 (128, 128, 0),
                 (255, 190, 230),
                 (40, 110, 170),
                 (200, 250, 255),
                 (0, 0, 128),
                 (195, 255, 170)]

They were implemented like this to be diverse and cover wide range of colors, because just choosing random RGB values may lead to some similiarty between colors of diff classes (e.g., both are similar shades of blue)

The main goal is to create a color generator class that generates colors that are not limited (here we have 12 colors) and sample them for a distribution keeps them dfferent from each other, after making this generator it must replaces all the occurenecs of this hard coded code

kausthub-kannan commented 9 months ago

Hello @0ssamaak0 , I would like to work on this issue, can you assign it to me?

0ssamaak0 commented 9 months ago

it's already assigned, plesae check discord server

yash8000 commented 9 months ago

can we solve this by using random function to generate random colours eg generate values between 0-255

0ssamaak0 commented 9 months ago

can we solve this by using random function to generate random colours eg generate values between 0-255

no, it may result in very similar colors, check the issue description. anyway someone has worked on it and made a pull request