You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When following the instructions for adding a new annotation format, at the bottom there is a snippet to import labeled shapes, however when trying to run this
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/**/cvat/cvat/apps/dataset_manager/bindings.py", line 683, in add_shape
imported_shape = self._import_shape(shape)
File "/**/cvat/cvat/apps/dataset_manager/bindings.py", line 606, in _import_shape
label_id = self._get_label_id(_shape.pop('label'), parent_label_id)
File "/**/cvat/cvat/apps/dataset_manager/bindings.py", line 109, in _get_label_id
raise ValueError("Label {!r} is not registered for this task".format(label_name))
ValueError: Label 'car' is not registered for this task
After scouring the code for a bit, I didn't find an easy way of adding labels like task_data.add_label. It seems pretty much all other annotation formats rely on datumaro and the label handling seems to be done by it.
I could add the label "manually" to task_data._label_mapping to prevent the failure above, but since _label_mapping is a private member variable I don't think that's the intended way, and there might be side effects that I'm unaware about.
What's the "official" way to do this?
Thanks!
The text was updated successfully, but these errors were encountered:
Hi all!
When following the instructions for adding a new annotation format, at the bottom there is a snippet to import labeled shapes, however when trying to run this
I get
After scouring the code for a bit, I didn't find an easy way of adding labels like
task_data.add_label
. It seems pretty much all other annotation formats rely on datumaro and the label handling seems to be done by it.I could add the label "manually" to
task_data._label_mapping
to prevent the failure above, but since_label_mapping
is a private member variable I don't think that's the intended way, and there might be side effects that I'm unaware about.What's the "official" way to do this?
Thanks!
The text was updated successfully, but these errors were encountered: