Skip to content

Commit

Permalink
Merge pull request #162 from biigle/patch-1
Browse files Browse the repository at this point in the history
Reduce chunk size in process annotated video job
  • Loading branch information
mzur committed Feb 26, 2024
2 parents 46210b5 + 64d12b3 commit 48b388b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Jobs/ProcessAnnotatedVideo.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ class ProcessAnnotatedVideo extends ProcessAnnotatedFile
public function handleFile(VolumeFile $file, $path)
{
$video = $this->getVideo($path);
$this->getAnnotationQuery($file)->chunkById(
1000,
fn ($a) => $this->processAnnotationChunk($a, $video)
);
// The chunk size is rather low because individual video annotations can contain
// lots of data (if they are multi-frame annotations from object tracking with
// many annotated frames). With a chunk size too large, this could run into out
// of memory issues.
$this->getAnnotationQuery($file)
->chunkById(100, fn ($a) => $this->processAnnotationChunk($a, $video));
}

/**
Expand Down

0 comments on commit 48b388b

Please sign in to comment.