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

Keep preview in cache during task creation #8766

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Changes from all commits
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 cvat/apps/engine/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

from cvat.apps.engine import models
from cvat.apps.engine.log import ServerLogManager
from cvat.apps.engine.frame_provider import TaskFrameProvider
from cvat.apps.engine.media_extractors import (
MEDIA_TYPES, CachingMediaIterator, IMediaReader, ImageListReader,
Mpeg4ChunkWriter, Mpeg4CompressedChunkWriter, RandomAccessIterator,
Expand Down Expand Up @@ -1499,6 +1500,9 @@ def _to_abs_frame(rel_frame: int) -> int:
):
_create_static_chunks(db_task, media_extractor=extractor, upload_dir=upload_dir)

# Prepare the preview image and save it in the cache
TaskFrameProvider(db_task=db_task).get_preview()

def _create_static_chunks(db_task: models.Task, *, media_extractor: IMediaReader, upload_dir: str):
@attrs.define
class _ChunkProgressUpdater:
Expand Down
Loading