Skip to content

Commit 3726152

Browse files
committed
Unify contour str reprs
1 parent 93b514d commit 3726152

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/python/model_api/models/result/segmentation.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,8 @@ def __init__(self, label: str, probability: float, shape: np.ndarray, child_shap
156156
self.child_shapes = child_shapes
157157

158158
def __str__(self):
159-
repr = f"{self.label}: {self.probability:.3f}, {len(self.shape)}"
160-
if self.child_shapes is not None:
161-
repr += f", {len(self.child_shapes)}"
162-
return repr
159+
num_children = len(self.child_shapes) if self.child_shapes is not None else 0
160+
return f"{self.label}: {self.probability:.3f}, {len(self.shape)}, {num_children}"
163161

164162
def __repr__(self):
165163
return self.__str__()

0 commit comments

Comments
 (0)