We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1a32e42 + 05ba15f commit 1f356b3Copy full SHA for 1f356b3
1 file changed
inference/core/cache/serializers.py
@@ -118,10 +118,8 @@ def from_instance_segmentation_response(
118
119
120
def from_keypoints_detection_response(response: KeypointsDetectionInferenceResponse):
121
- predictions = []
122
- for pred in response.predictions:
123
- for keypoint in pred.keypoints:
124
- predictions.append(
125
- {"class": keypoint.class_name, "confidence": keypoint.confidence}
126
- )
127
- return predictions
+ return [
+ {"class": keypoint.class_name, "confidence": keypoint.confidence}
+ for pred in response.predictions
+ for keypoint in pred.keypoints
+ ]
0 commit comments