Skip to content

Bug Fix in sort_utils.py #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

theprashasst
Copy link

Description

This pull request updates the import path for the box_iou_batch function to reflect its new location in the supervision library. The function has been moved from supervision.detection.utils to supervision.detection.utils.iou_and_nms.

This change ensures that our codebase remains compatible with the latest versions of the supervision library and prevents ImportError exceptions.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this change been tested?

To test this change, you can run any of the existing object tracking scripts that rely on Intersection over Union (IoU) calculations. For example, you can run a script that uses a byte-tracker with the following steps:

  1. Initialize an object detector to get bounding boxes.
  2. Initialize a Sort object.
  3. Process a video frame to get detections.
  4. Update the tracker with the new detections.

The tracker will internally call box_iou_batch to compare the IoU of detection and track bounding boxes. If the script runs without any import errors, the change has been successfully tested.

Any specific deployment considerations

There are no specific deployment considerations for this change. This is a dependency path update and does not alter the logic of the application.

Docs

  • Docs updated? What were the changes:
    • No documentation changes are required for this update.

fixed import error of box_iou_batch 

box_iou_batch has been moved from supervision.detection.utils to supervision.detection.utils.iou_and_nms
@CLAassistant
Copy link

CLAassistant commented Jul 31, 2025

CLA assistant check
All committers have signed the CLA.

@theprashasst
Copy link
Author

I have read the CLA Document and I sign the CLA.

@Ashp116
Copy link

Ashp116 commented Jul 31, 2025

Hi @theprashasst, it is fixed within supervision. Check #116

@@ -3,7 +3,7 @@

import numpy as np
import supervision as sv
from supervision.detection.utils import box_iou_batch
from supervision.detection.utils.iou_and_nms import box_iou_batch
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about instead of importing like this from supervision.detection.utils.iou_and_nms import box_iou_batch we will simply use box_iou_batch like this sv.box_iou_batch ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants