Skip to content

Commit 638b0be

Browse files
authored
Merge pull request #10 from DagsHub/bug/missing-filename-in-poses
Fix missing filename in _reimport_poses
2 parents 7b97223 + 106a698 commit 638b0be

File tree

1 file changed

+5
-0
lines changed
  • dagshub_annotation_converter/formats/label_studio

1 file changed

+5
-0
lines changed

dagshub_annotation_converter/formats/label_studio/task.py

+5
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def _reimport_poses(self, annotations: List[IRImageAnnotationBase]) -> List[IRIm
143143
category: Optional[str] = None
144144
image_width: Optional[int] = None
145145
image_height: Optional[int] = None
146+
filename: Optional[str] = None
146147
if maybe_bbox is None:
147148
logger.warning(
148149
f"Bounding box of pose with annotation ID {bbox_id} "
@@ -155,6 +156,7 @@ def _reimport_poses(self, annotations: List[IRImageAnnotationBase]) -> List[IRIm
155156
category = bbox.ensure_has_one_category()
156157
image_height = bbox.image_height
157158
image_width = bbox.image_width
159+
filename = bbox.filename
158160
annotations_to_remove.add(bbox_id)
159161
# Fetch the points
160162
points: List[IRPosePoint] = []
@@ -176,6 +178,8 @@ def _reimport_poses(self, annotations: List[IRImageAnnotationBase]) -> List[IRIm
176178
image_width = maybe_point.image_width
177179
if image_height is None:
178180
image_height = maybe_point.image_height
181+
if filename is None:
182+
filename = maybe_point.filename
179183
points.extend(maybe_point.points)
180184
annotations_to_remove.add(point_id)
181185

@@ -193,6 +197,7 @@ def _reimport_poses(self, annotations: List[IRImageAnnotationBase]) -> List[IRIm
193197
coordinate_style=CoordinateStyle.NORMALIZED,
194198
image_width=image_width,
195199
image_height=image_height,
200+
filename=filename,
196201
)
197202
if bbox is not None:
198203
sum_annotation.width = bbox.width

0 commit comments

Comments
 (0)