Skip to content

Commit e819db8

Browse files
authored
clarify start-label validation message
1 parent 7de5628 commit e819db8

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

poseinterface/clips.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def _extract_start_labels(clip_labels: dict) -> dict:
2525
start_images = [img for img in clip_labels["images"] if img["id"] == 0]
2626
if len(start_images) != 1:
2727
raise ValueError(
28-
"Clip labels must contain exactly one image with id 0"
28+
"Clip labels must contain exactly one first-frame image with id 0"
2929
)
3030

3131
return {
@@ -363,6 +363,7 @@ def extract_start_frames_label_s3(
363363
raise FileNotFoundError(
364364
f"File not found on S3: {s3_cliplabels_uri}"
365365
) from e
366+
# Preserve other S3 client errors, but log them for easier diagnosis.
366367
logging.error(
367368
"Failed to extract start labels from %s (S3 error: %s)",
368369
s3_cliplabels_uri,

tests/test_unit/test_clips.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ def test_extract_start_labels_requires_first_frame(video_labels):
180180
"annotations": [{"image_id": 1, "id": 1}],
181181
}
182182

183-
with pytest.raises(ValueError, match="exactly one image with id 0"):
183+
with pytest.raises(
184+
ValueError,
185+
match="exactly one first-frame image with id 0",
186+
):
184187
_extract_start_labels(clip_labels)
185188

186189

0 commit comments

Comments
 (0)