Skip to content

Commit

Permalink
Sort frames during project dumping (#6927)
Browse files Browse the repository at this point in the history
When we export a task or project in CVAT format [our code
uses](https://github.com/opencv/cvat/blob/d497bb6a90dd3c9625c3c8e8f73278019e21983d/cvat/apps/dataset_manager/formats/cvat.py#L717)
the `group_by_frame` function. For tasks and for projects behaviour of
this function is different since for tasks [we perform sorting
frames](https://github.com/opencv/cvat/blob/d497bb6a90dd3c9625c3c8e8f73278019e21983d/cvat/apps/dataset_manager/bindings.py#L420-L421)
but for projects [we
don't](https://github.com/opencv/cvat/blob/d497bb6a90dd3c9625c3c8e8f73278019e21983d/cvat/apps/dataset_manager/bindings.py#L1152-L1154).
As a result, we can have a situation when our annotation file for the
project will have a list of images in unsorted form. So this PR adds
sorting frames during project export as well.
  • Loading branch information
Kirill Sizov authored Oct 5, 2023
1 parent bfc86ae commit ae1dc1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Downloading additional data from cloud storage if use_cache=true and job_file_mapping are specified
(<https://github.com/opencv/cvat/pull/6879>)
- Leaving an organization (<https://github.com/opencv/cvat/pull/6422>)
- Order of images in annotation file when dumping project in CVAT format (<https://github.com/opencv/cvat/pull/6927>)
- Validation on Cloud Storage form / error message on create task form (<https://github.com/opencv/cvat/pull/6890>)


## \[2.7.1\] - 2023-09-15

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion cvat/apps/dataset_manager/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ def get_frame(task_id: int, idx: int) -> ProjectData.Frame:
return frames[(frame_info["subset"], abs_frame)]

if include_empty:
for ident in self._frame_info:
for ident in sorted(self._frame_info):
if ident not in self._deleted_frames:
get_frame(*ident)

Expand Down

0 comments on commit ae1dc1b

Please sign in to comment.