Skip to content

Commit

Permalink
Keep preview in cache during task creation
Browse files Browse the repository at this point in the history
  • Loading branch information
azhavoro committed Dec 3, 2024
1 parent 17ec908 commit 1b23a9d
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit 1b23a9d

Please sign in to comment.