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

Export dataset in CVAT format misses frames in tasks with non-default… #8662

Merged
merged 6 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog.d/20241107_165701_sekachev.bs_fixed_export.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Export dataset in CVAT format misses frames in tasks with non-default frame step
(<https://github.com/cvat-ai/cvat/pull/XXXX>)
bsekachev marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions cvat/apps/dataset_manager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def export(dst_format, project_id=None, task_id=None, job_id=None, server_url=No
instance_update_time = timezone.localtime(db_instance.updated_date)
if isinstance(db_instance, Project):
tasks_update = list(map(
lambda db_task: timezone.localtime(db_task.updated_date),
db_instance.tasks.all()
lambda updated_date: timezone.localtime(updated_date),
db_instance.tasks.values_list('updated_date', flat=True)
bsekachev marked this conversation as resolved.
Show resolved Hide resolved
))
instance_update_time = max(tasks_update + [instance_update_time])

Expand Down
2 changes: 1 addition & 1 deletion cvat/apps/engine/frame_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def iterate_frames(
quality: FrameQuality = FrameQuality.ORIGINAL,
out_type: FrameOutputType = FrameOutputType.BUFFER,
) -> Iterator[DataWithMeta[AnyFrame]]:
frame_range = itertools.count(start_frame, self._db_task.data.get_frame_step())
frame_range = itertools.count(start_frame)
Copy link
Contributor

@zhiltsov-max zhiltsov-max Nov 7, 2024

Choose a reason for hiding this comment

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

Probably, db_segment_frame_set below has to be converted to relative ids. There is the get_rel_frame_number() method for this

Copy link
Member Author

Choose a reason for hiding this comment

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

Converted idx to absolute instead as it done in another iterate_frames

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, please call dev/format_python_code.sh

Copy link
Member Author

Choose a reason for hiding this comment

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

Why not to add it to git pre-commit hook?

Copy link
Contributor

Choose a reason for hiding this comment

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

There is a problem with determining the right interpreter in a cross-platform manner.

if stop_frame:
frame_range = itertools.takewhile(lambda x: x <= stop_frame, frame_range)

Expand Down
Loading