Summary
If an image processing job gets interrupted, the thumbnail images of the detections may be missing. There is a management command to fill-in missing images, however it must be run manually by system admins. This could be run as a periodic task, or another automated hook.
ami/ml/management/commands/create_missing_detection_images.py
The underlying function is already extracted here:
|
def get_source_images_with_missing_detection_images( |
|
queryset: QuerySet[SourceImage] | None = None, batch_size: int = 100 |
|
) -> QuerySet[SourceImage]: |
|
if queryset is None: |
|
queryset = SourceImage.objects.all() |
|
|
|
return queryset.filter( |
|
Exists(Detection.objects.filter(source_image=OuterRef("pk"), path__isnull=True)) |
|
).prefetch_related("detections", "deployment__project")[:batch_size] |
Summary
If an image processing job gets interrupted, the thumbnail images of the detections may be missing. There is a management command to fill-in missing images, however it must be run manually by system admins. This could be run as a periodic task, or another automated hook.
ami/ml/management/commands/create_missing_detection_images.pyThe underlying function is already extracted here:
antenna/ami/ml/media.py
Lines 17 to 25 in 81a7864