Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #5 from retailnext/mt/add_data_path
Browse files Browse the repository at this point in the history
Add data_path attribute to lambda manager payload
  • Loading branch information
mikhail-treskin authored Jul 1, 2023
2 parents 31f78d5 + 6bab710 commit 54178a6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cvat/apps/lambda_manager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit 54178a6

Please sign in to comment.