Skip to content

Commit

Permalink
Prevent modification of the input argument (targets) in DetectionVisu…
Browse files Browse the repository at this point in the history
…alization.visualize_batch (#1652)
  • Loading branch information
BloodAxe authored Nov 21, 2023
1 parent 8e9f9d4 commit f063efd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/super_gradients/training/utils/detection_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def visualize_batch(
0 for invisible, 1 for fully opaque
"""
image_np = undo_preprocessing_func(image_tensor.detach())
targets = DetectionVisualization._scaled_ccwh_to_xyxy(target_boxes.detach().cpu().numpy(), *image_np.shape[1:3], image_scale)
targets = DetectionVisualization._scaled_ccwh_to_xyxy(target_boxes.detach().cpu().numpy().copy(), *image_np.shape[1:3], image_scale)
if pred_boxes is None:
pred_boxes = [None for _ in range(image_np.shape[0])]

Expand Down

0 comments on commit f063efd

Please sign in to comment.