Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: custom label colors #1480

Closed
myounus96 opened this issue Apr 30, 2020 · 10 comments · Fixed by #2014
Closed

Feature: custom label colors #1480

myounus96 opened this issue Apr 30, 2020 · 10 comments · Fixed by #2014
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@myounus96
Copy link

Is this possible?
Like red for person,blue for car,so whenever I annotate a car it should've blue color and whenever I annotate person it should've red color.

@zhiltsov-max
Copy link
Contributor

Currently, there is no way to do this in UI. However, it is possible in Datumaro, where you can provide a custom colormap for export in voc_segmentation format.

@nmanovic
Copy link
Contributor

nmanovic commented May 1, 2020

@m-younus , please don't ignore our issue template. You can choose a color in UI for a label (temporary). I will close the issue. Don't hesitate to re-open if you can share more information how you want it should be implemented.

@nmanovic nmanovic closed this as completed May 1, 2020
@nmanovic nmanovic added the question Further information is requested label May 1, 2020
@zhiltsov-max
Copy link
Contributor

zhiltsov-max commented May 12, 2020

@bsekachev, as we already have a temporary color selector for labels in UI
image
can we extend this to be persistent and provide same selector at the task page?
Here:
image
As tasks can have more than N labels, I think it would be nice to provide just a typical color selector like we can see in most of image editors - with exact numbers and a palette.

Example (PDN):
image

@bsekachev
Copy link
Member

@zhiltsov-max

We can, but:

  1. First need implement the feature on the server (storing color in the database)
  2. I suppose predefined colors not enough in general case. We need something more advanced. But on the first iteration we might support only predefined colors.

@zhiltsov-max zhiltsov-max added enhancement New feature or request and removed question Further information is requested labels May 12, 2020
@zhiltsov-max zhiltsov-max changed the title Assign same custom color per label Feature: custom label colors May 12, 2020
@zhiltsov-max zhiltsov-max reopened this May 12, 2020
@zhiltsov-max zhiltsov-max added this to the Backlog milestone May 12, 2020
@bsekachev bsekachev modified the milestones: Backlog, 1.1.0-release Jul 9, 2020
@creativesiva
Copy link

Currently, there is no way to do this in UI. However, it is possible in Datumaro, where you can provide a custom colormap for export in voc_segmentation format.

Hi Could you please let suggest how to setup custom colors for segmentation using Datumaro
Thanks

@zhiltsov-max
Copy link
Contributor

Please check the last example here.

@creativesiva
Copy link

creativesiva commented Aug 3, 2020

Could you pls help me to fix below issue, I am running this command "datum project import --format voc --input-path /home/aipl/segmentation/images/siva"

my directory structure
+Annotations
+ImageSets
+JPEGImages
+labelmap.txt (changed color codes)

(myannotation) siva@siva-dl:~$ datum project import --format voc --input-path /home/aipl/segmentation/images/siva
2020-08-03 18:25:13,355 WARNING: Failed to import module 'openvino_launcher.py': libpython3.7m.so.1.0: cannot open shared object file: No such file or directory
2020-08-03 18:25:15,691 INFO: Importing project from '/home/aipl/segmentation/images/siva'
2020-08-03 18:25:15,691 INFO: Importing project as 'voc'
2020-08-03 18:25:15,691 INFO: Checking the dataset...
2020-08-03 18:25:15,696 ERROR: Train
Traceback (most recent call last):
File "/home/aipl/anaconda3/envs/myannotation/bin/datum", line 8, in
sys.exit(main())
File "/home/aipl/anaconda3/envs/myannotation/lib/python3.8/site-packages/datumaro/cli/main.py", line 114, in main
return args.command(args)
File "/home/aipl/anaconda3/envs/myannotation/lib/python3.8/site-packages/datumaro/cli/contexts/project/init.py", line 222, in import_command
dataset = project.make_dataset()
File "/home/aipl/anaconda3/envs/myannotation/lib/python3.8/site-packages/datumaro/components/project.py", line 815, in make_dataset
return ProjectDataset(self)
File "/home/aipl/anaconda3/envs/myannotation/lib/python3.8/site-packages/datumaro/components/project.py", line 554, in init
for item in source:
File "/home/aipl/anaconda3/envs/myannotation/lib/python3.8/site-packages/datumaro/plugins/voc_format/extractor.py", line 127, in iter
anns = self._parse_annotations(root_elem)
File "/home/aipl/anaconda3/envs/myannotation/lib/python3.8/site-packages/datumaro/plugins/voc_format/extractor.py", line 147, in _parse_annotations
obj_label_id = self._get_label_id(label_elem.text)
File "/home/aipl/anaconda3/envs/myannotation/lib/python3.8/site-packages/datumaro/plugins/voc_format/extractor.py", line 54, in _get_label_id
assert label_id is not None, label
AssertionError: Train

@zhiltsov-max
Copy link
Contributor

Apparently, the dataset has a Train class, which is not listed in the labelmap.txt, make sure all the classes are listed in this file. Names are case sensitive. More information on the file usage here.

@creativesiva
Copy link

It worked now. Thanks a lot.

@creativesiva
Copy link

Looks like there is limitation in the #colors, I am trying to add 70 classes (labelmap.txt), But when i download the project after segmentation using UI, the labelmap color codes are changing.

@ActiveChooN ActiveChooN mentioned this issue Aug 11, 2020
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants