diff --git a/cvat/apps/lambda_manager/views.py b/cvat/apps/lambda_manager/views.py index 5f154366bff9..a12e272d4d41 100644 --- a/cvat/apps/lambda_manager/views.py +++ b/cvat/apps/lambda_manager/views.py @@ -34,7 +34,7 @@ import cvat.apps.dataset_manager as dm from cvat.apps.engine.frame_provider import FrameProvider -from cvat.apps.engine.models import Job, ShapeType, SourceType, Task +from cvat.apps.engine.models import Job, ShapeType, SourceType, Task, DataChoice from cvat.apps.engine.serializers import LabeledDataSerializer from cvat.apps.lambda_manager.serializers import ( FunctionCallRequestSerializer, FunctionCallSerializer @@ -285,8 +285,15 @@ def invoke( if self.kind == LambdaType.DETECTOR: + if db_task.data.original_chunk_type == DataChoice.VIDEO: + data_path = db_task.data.video.path + elif db_task.data.original_chunk_type == DataChoice.IMAGESET: + data_path = db_task.data.images.get(frame=data["frame"]).path + else: + data_path = "" payload.update({ - "image": self._get_image(db_task, data["frame"], quality) + "image": self._get_image(db_task, data["frame"], quality), + "data_path": data_path }) elif self.kind == LambdaType.INTERACTOR: payload.update({