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

Impossible import annotations with points in LFW 1.0 format #5100

Open
2 tasks
Marishka17 opened this issue Oct 12, 2022 · 2 comments · May be fixed by cvat-ai/datumaro#19
Open
2 tasks

Impossible import annotations with points in LFW 1.0 format #5100

Marishka17 opened this issue Oct 12, 2022 · 2 comments · May be fixed by cvat-ai/datumaro#19
Labels
bug Something isn't working dataset good first issue Good for newcomers

Comments

@Marishka17
Copy link
Contributor

My actions before raising this issue

Expected Behaviour

Current Behaviour

Possible Solution

Steps to Reproduce (for bugs)

  1. Restore demo_task.zip
  2. Export annotations in LFW format
  3. Upload annotations

Context

Details
Traceback (most recent call last):
  File "/home/maya/Documents/cvat_ai/cvat/.env/lib/python3.8/site-packages/rq/worker.py", line 936, in perform_job
    rv = job.perform()
  File "/home/maya/Documents/cvat_ai/cvat/.env/lib/python3.8/site-packages/rq/job.py", line 684, in perform
    self._result = self._execute()
  File "/home/maya/Documents/cvat_ai/cvat/.env/lib/python3.8/site-packages/rq/job.py", line 690, in _execute
    return self.func(*self.args, **self.kwargs)
  File "/usr/lib/python3.8/contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "/home/maya/Documents/cvat_ai/cvat/cvat/apps/dataset_manager/task.py", line 775, in import_task_annotations
    task.import_annotations(f, importer)
  File "/home/maya/Documents/cvat_ai/cvat/cvat/apps/dataset_manager/task.py", line 658, in import_annotations
    importer(src_file, task_data, **options)
  File "/home/maya/Documents/cvat_ai/cvat/cvat/apps/dataset_manager/formats/registry.py", line 37, in __call__
    f_or_cls(*args, **kwargs)
  File "/home/maya/Documents/cvat_ai/cvat/cvat/apps/dataset_manager/formats/lfw.py", line 21, in _import
    dataset = Dataset.import_from(tmp_dir, 'lfw')
  File "/home/maya/Documents/cvat_ai/cvat/.env/lib/python3.8/site-packages/datumaro/components/dataset.py", line 1214, in import_from
    env.make_extractor(src_conf.format, src_conf.url, **extractor_kwargs)
  File "/home/maya/Documents/cvat_ai/cvat/.env/lib/python3.8/site-packages/datumaro/components/environment.py", line 230, in make_extractor
    return self.extractors.get(name)(*args, **kwargs)
  File "/home/maya/Documents/cvat_ai/cvat/.env/lib/python3.8/site-packages/datumaro/plugins/lfw_format.py", line 45, in __init__
    self._items = list(self._load_items(path).values())
  File "/home/maya/Documents/cvat_ai/cvat/.env/lib/python3.8/site-packages/datumaro/plugins/lfw_format.py", line 199, in _load_items
    annotations.append(Points([float(p) for p in line[1:]], label=label))
UnboundLocalError: local variable 'label' referenced before assignment

Your Environment

  • Git hash commit (git log -1): c3dd349
  • Docker version docker version (e.g. Docker 17.0.05):
  • Are you using Docker Swarm or Kubernetes?
  • Operating System and version (e.g. Linux, Windows, MacOS):
  • Code example or link to GitHub repo or gist to reproduce problem:
  • Other diagnostic information / logs:
    Logs from `cvat` container
@Marishka17 Marishka17 added the bug Something isn't working label Oct 12, 2022
@yasakova-anastasia yasakova-anastasia self-assigned this Nov 30, 2022
@sizov-kirill sizov-kirill linked a pull request Dec 1, 2022 that will close this issue
7 tasks
@sizov-kirill
Copy link
Contributor

The main problem here is usage of LFW format.

LFW format it's mainly for working with tags not with points.
Yes, LFW format has landmark.txt that describes facial landmarks for images, but format doesn't support any labels for these landmarks it's just face points that has no any labels.
So having only points without any tags has no meaning from LFW format point of view.

But I agree that if we can export dataset in some format we should be able to import exported annotations as well, so I prepared PR in Datumaro, that eliminate this error that occurs during importing this annotations in LFW.

Also I'll prepare PR for cvat documenatation where I'll fix description of LFW format in our docs.

@yasakova-anastasia yasakova-anastasia removed their assignment Dec 2, 2022
@zhiltsov-max
Copy link
Contributor

From my point, the situation can be formulated as "garbage in - garbage out". The format doesn't suppose the annotations from the task in the issue, but following the documentation, it's not clear how to use the format and how to prepare annotations to make it working. I think, we should document the required annotations, make sure it's clear how to use the format and that we can annotate a meaningful dataset in this format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dataset good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants