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 order #4087

Merged
merged 5 commits into from
Jan 11, 2022
Merged

Fix order #4087

merged 5 commits into from
Jan 11, 2022

Conversation

Marishka17
Copy link
Contributor

@Marishka17 Marishka17 commented Dec 27, 2021

Motivation and context

Resolve #4025

How has this been tested?

Manually

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.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

@Marishka17 Marishka17 changed the title [WIP] Fix order Fix order Dec 27, 2021
@zhiltsov-max
Copy link
Contributor

Could you check these lines? If the results are in the reversed order, it looks like the annotation_ir is reversed. I'm not sure that the order in frame_info is a valid (or reliable) fix.

self.db_task = models.Task.objects.prefetch_related("data__images").get(id=pk)
self.db_task = models.Task.objects.prefetch_related(
Prefetch('data__images', queryset=models.Image.objects.order_by('frame'))
).get(id=pk)

# Postgres doesn't guarantee an order by default without explicit order_by
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this comment also applies to the current fix.

zhiltsov-max
zhiltsov-max previously approved these changes Dec 28, 2021
Copy link
Contributor

@zhiltsov-max zhiltsov-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I'm the right person to review questions related to CVAT DB use, but for me the current fix looks more or less valid. If you see how we can enforce annotation ordering independently of DB requests, I'd prefer such solution.

nmanovic
nmanovic previously approved these changes Jan 11, 2022
Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nmanovic nmanovic dismissed stale reviews from zhiltsov-max and themself via 90658f9 January 11, 2022 13:39
@nmanovic nmanovic merged commit 297a9cc into develop Jan 11, 2022
@nmanovic nmanovic deleted the mk/fix_order_in_annotation branch January 11, 2022 13:39
@nmanovic nmanovic mentioned this pull request Mar 4, 2022
7 tasks
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.

Assignement of labels to frames occurs in reveresed order
3 participants