Skip to content

Commit 4ac7b10

Browse files
committed
fix(server): add single frame edge case
1 parent e8833ce commit 4ac7b10

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sign_language_segmentation/server.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ def pose_segmentation():
5959
with pose_file_path.open("rb") as f:
6060
pose = Pose.read(f)
6161

62+
if len(pose.body.data) == 1:
63+
# Otherwise, segment_pose gives an error:
64+
# > too many indices for array: array is 1-dimensional, but 2 were indexed
65+
return make_response(jsonify(message="Pose has only one frame, no segmentation needed", path=body["output"]), 200)
66+
6267
eaf, tiers = segment_pose(pose)
6368

6469
output_file_path.parent.mkdir(parents=True, exist_ok=True)

0 commit comments

Comments
 (0)