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

Fix: Can't dump annotations with objects type is track from several jobs #5250

Merged
merged 10 commits into from
Nov 24, 2022

Conversation

yasakova-anastasia
Copy link
Contributor

@yasakova-anastasia yasakova-anastasia commented Nov 7, 2022

Motivation and context

Fixed #3200

How has this been tested?

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@zhiltsov-max
Copy link
Contributor

The export seems to be working. However, I failed to import the exported back.

task_test_3200_backup_2022_11_07_17_58_38.zip
task_test_3200-2022_11_07_17_58_38-cvat for video 1.1.zip

 File "/usr/lib/python3.8/contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "/home/django/cvat/apps/dataset_manager/task.py", line 775, in import_task_annotations
    task.import_annotations(f, importer, conv_mask_to_poly=conv_mask_to_poly)
  File "/home/django/cvat/apps/dataset_manager/task.py", line 660, in import_annotations
    self.create(task_data.data.serialize())
  File "/home/django/cvat/apps/dataset_manager/task.py", line 617, in create
    self._patch_data(data, PatchAction.CREATE)
  File "/home/django/cvat/apps/dataset_manager/task.py", line 607, in _patch_data
    self._merge_data(_data, jobs[jid]["start"], self.db_task.overlap)
  File "/home/django/cvat/apps/dataset_manager/task.py", line 611, in _merge_data
    annotation_manager.merge(data, start_frame, overlap)
  File "/home/django/cvat/apps/dataset_manager/annotation.py", line 158, in merge
    tracks.merge(data.tracks, start_frame, overlap)
  File "/home/django/cvat/apps/dataset_manager/annotation.py", line 241, in merge
    cost_matrix[i][j] = 1 - self._calc_objects_similarity(
  File "/home/django/cvat/apps/dataset_manager/annotation.py", line 414, in _calc_objects_similarity
    obj1_shapes = TrackManager.get_interpolated_shapes(obj1, start_frame, end_frame)
  File "/home/django/cvat/apps/dataset_manager/annotation.py", line 758, in get_interpolated_shapes
    if not prev_shape["outside"]:
KeyError: 'outside'

@yasakova-anastasia yasakova-anastasia marked this pull request as draft November 7, 2022 18:47
@yasakova-anastasia yasakova-anastasia marked this pull request as ready for review November 8, 2022 15:57
@zhiltsov-max
Copy link
Contributor

zhiltsov-max commented Nov 13, 2022

The annotation import seem to be working. However, I failed to import the exported task as a dataset into an empty project.

    project.import_dataset(f, importer, conv_mask_to_poly=conv_mask_to_poly)
  File "/cvat/apps/dataset_manager/project.py", line 146, in import_dataset
    self.create({tid: ir.serialize() for tid, ir in self.annotation_irs.items() if tid in project_data.new_tasks})
  File "/cvat/apps/dataset_manager/project.py", line 54, in create
    self.task_annotations[task_id].create(data)
  File "/cvat/apps/dataset_manager/task.py", line 626, in create
    self._patch_data(data, PatchAction.CREATE)
  File "/cvat/apps/dataset_manager/task.py", line 606, in _patch_data
    splitted_data[jid] = _data.slice(start, stop)
  File "/cvat/apps/dataset_manager/annotation.py", line 133, in slice
    track = self._slice_track(t, start, stop)
  File "/cvat/apps/dataset_manager/annotation.py", line 101, in _slice_track
    interpolated_shapes = TrackManager.get_interpolated_shapes(
  File "/cvat/apps/dataset_manager/annotation.py", line 751, in get_interpolated_shapes
    assert shape["frame"] > prev_shape["frame"]

task_test_3200-2022_11_13_09_23_21-cvat for video 1.1.zip

Also, something about backup import looks broken, but I can't say what it is exactly. I removed the task from the first testing and can't compare. I feel like I was annotating a bit differently, but having tested it now, I don't see errors.

@yasakova-anastasia
Copy link
Contributor Author

The annotation import seem to be working. However, I failed to import the exported task as a dataset into an empty project.

Fixed.

Also, something about backup import looks broken, but I can't say what it is exactly. I removed the task from the first testing and can't compare. I feel like I was annotating a bit differently, but having tested it now, I don't see errors.

I think there is a problem on the UI. overlap > 0 in the task, so when annotations are added to one job, it must be added to the corresponding frames of another job. This is not happening.

@nmanovic nmanovic merged commit 279f01b into develop Nov 24, 2022
@nmanovic nmanovic deleted the ay/fix_shapes_interpolation branch November 24, 2022 14:22
@nmanovic nmanovic mentioned this pull request Dec 12, 2022
@zhouxiao999
Copy link

I still have this problem with the latest version test today.
A video is divided into multiple jobs. If several jobs contain track:

  1. Export task as a dataset with video 1.1 (images 1.1 is ok,no such problem)
  2. upload anotation without modifying it,the system displays "Error: Request failed with status code 500. "KeyError: 'type'\n"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't dump annotations with objects type is track from several jobs (annotation is created in all job).
4 participants