Skip to content

Using BayesianTracker with bounding box input #200

Answered by quantumjot
cedarwarman asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @cedarwarman - this looks super cool. I'm assuming that your bounding boxes are coming from a Pytorch FasterRCNN. If so, the following code snippet should help:

from btrack.btypes import PyTrackObject

objects = []

for t, img in enumerate(movie):

    # grab the detections from the frame of the movie
    detections = detector.predict(img)
    detections = torch.cat(
        [
            detections["boxes"],
            detections["scores"][:, None],
            detections["labels"][:, None],
            # detections["features"],
        ], axis=-1
    ).cpu().numpy()

    # now convert each detection to a btrack object for tracking
    for detection in detections:
        obj_data =

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by cedarwarman
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants