Skip to content

Commit 7ee8735

Browse files
committed
str method
1 parent f17dec2 commit 7ee8735

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

patched_yolo_infer/nodes/CombineDetections.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ def not_agnostic_nms(
448448
return all_keeps
449449

450450
def __str__(self):
451-
# List of useful attributes (non-empty ones)
451+
# Print the list of useful attributes (non-empty ones)
452452
useful_attributes = []
453453
if self.filtered_confidences:
454454
useful_attributes.append("filtered_confidences")
@@ -465,7 +465,7 @@ def __str__(self):
465465

466466
# If all attributes are empty
467467
if not useful_attributes:
468-
return "Useful attributes: nothing detected in the frame."
468+
return "Useful attributes: nothing detected in the frame"
469469

470470
# Build the output string
471471
output = "Useful attributes: " + ", ".join(useful_attributes) + "\n\n"

patched_yolo_infer/nodes/MakeCropsDetectThem.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,3 +296,10 @@ def _calculate_batch_inference(
296296
else:
297297
# Get the masks
298298
crop.detected_masks = pred.masks.data.cpu().numpy()
299+
300+
def __str__(self):
301+
# Print info about patches amount
302+
return (
303+
f"{len(self.crops)} patches of size {self.crops[0].crop.shape} "
304+
f"were created from an image sized {self.image.shape}"
305+
)

0 commit comments

Comments
 (0)