Skip to content

v-prgmr/SORT-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SORT for Android (Java)

A Java implementation of the SORT (Simple Online and Realtime Tracking) algorithm, ready to integrate into Android applications.

If you are developing an Android app that involves object detection and need to track and associate objects across frames, this Java port provides a straightforward solution.

This implementation is based on Alex Bewley's original Python SORT.

Dependency

The SORT depends on the HungarianAlgorithm for IOU associations with Kalman Filter predictions and actual object detection predictions from your object detector. Include the HungarianAlgorithm.java file in your project along with the SORTTracker.java.

Usage

The method updateFromYOLO in SORTTracker.java is used to obtain the tracks based on the results from the object detection model. It takes as input the following

  • floating point array of all bounding boxes, bounding box format: [x_center, y_center, width, height]
  • string array of classLabels
  • interger of number of objects detected
public List<Track> updateFromYOLO(float[][] boundingBoxes, String[] classLabels, int numObjects);

Initialize the SORTTracker class as shown below in your object detection pipeline and pass the results from the object detection model into the updateFromYOLO method to get a list of tracks.

private SORTTracker tracker = new SORTTracker(250, 30, 0.3f);

The constructor of the SORTTracker takes the following as inputs

  • maxAge: Maximum number of consecutive frames an object can miss detection before it is removed from tracking.
  • minHits: Minimum number of consecutive frames an object must be detected before it is considered a valid track.
  • iouThreshold: Intersection-over-Union (IoU) threshold used to match predictions with new detections. Higher values make associations stricter.

Pass the results from the updateFromYOLO method into your visualiazation pipeline to render the results.

Cell id 1 and Cell id 2 are tracked over frames consistently

Here Cell id 1 and Cell id 2 are tracked over frames consistently without the jitteriness that occurs due to per frame inference while using just an object detector without a tracker.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages