What is Deep Sort?

What is Deep Sort?

(Last Updated On: May 11, 2022)

Object Tracking is an essential area in the digital domain. It entails the technique of monitoring just anything which may be an individual, ball or even an automobile throughout a chain of frames. For monitoring and tracking humans we would begin with all viable detections in a body and provide them an ID. In next frames we strive to hold ahead an individual’s ID. If the individual has moved far from the body then that ID is dropped. If a brand new individual comes in then they start out with a brand new ID.

This is a tough project considering the fact that human beings may appear similar which can lead the deep sort to replace IDs, human beings might also additionally get obstructed as in whilst a pedestrian or participant remains hidden in the back of a some other person or things might also additionally disappear and reappear in later frames.

In short, Deep Sort is basically a new algorithm for tracking people, things, and just anything through online or real time tracking and monitoring. Deep sort is of two types:

  • Single Object Tracking
  • Multiple Object Tracking

Let us discuss these two in depth below.

What is Single Object Tracking?

The Single Object Tracking type of deep sort is one of the most commonly known and used types. The goal here is to pin one object in the image and track it away from the frame. This type of tracking is relatively easy because it doesn’t necessarily have the big problem of distinguishing a particular object from other objects that may be in the frame.

What is Multiple Object Tracking?

This type of tracking is capable of capturing all the objects in the frame, uniquely identifying each one, and tracking everything until it leaves the frame. For example, in a marathon, it can track all the players running in the frame.

Object Tracking vs Object Detection

Today, the terms and their meanings in deep learning jargon are confusing and can lead to great confusion for new learners. So, what’s the difference between “object detection” and “object tracking”?

Object Detection recognizes the objects in the frame and places a bounding box or mask around them to classify the objects. Note that the detector work ends here. It processes each frame individually and identifies a large number of objects within that particular frame. However, the object tracker needs to track specific objects throughout the video. If the detector detects three cars in a frame, the object tracker must identify the three separate detections and track them in the next frame by using a unique ID.

To do this, the tracker must use a spatiotemporal function. This function will be discussed in a later section below.

What are the challenges faced in deep sort?

Tracking objects on straight roads or open areas can sound very easy. However, real-world applications are often less complex and challenge-free. Here are some common issues you may encounter while using the object tracker:

  • Occlusion

Occlusion of objects in video is one of the most common challenges faced in deep sort to track objects seamlessly. For example, if an individual enters into the tracker, he is recognized in the background, but when he occludes, the same male is not detected. The current challenge for trackers is to identify if the same type is found in a much later frame and link old tracks and features to that trajectory.

  • Variations in point of views

The purpose of tracking is often to track objects between different cameras. As a result, there is a big change in  the way objects are viewed. In such cases, the function used to track the object is very important because you need to make sure that it is immutable to changes in the view. Later, when coding your own tracker, you’ll see how to effectively overcome this.

  • Non stationary camera

If the camera used to track a particular object is also moving relative to the object, this can often have unplanned outcomes. As mentioned earlier, many trackers take into account the characteristics of an object in order to track it. Such trackers can fail in scenarios where objects look different (larger or smaller) due to camera movement. A robust tracker for this issue is very useful in critical applications such as object tracking drones and autonomous navigation.

How to apply deep sort in python?

Below is a code review for deep sort python process

class deepsort_rbc():

def __init__(self):

#loading this encoder is slow, and should be done only once.

self.encoder = torch.load(‘model640.pt’)

self.encoder = self.encoder.cuda()

self.encoder = self.encoder.eval()

print(“Deep sort model loaded”)

self.metric = nn_matching.NearestNeighborDistanceMetric(“cosine”,.5 , 100)

self.tracker= Tracker(self.metric)

self.gaussian_mask = get_gaussian_mask().cuda()


We hope this blog will help you fully understand the core ideas and components of object tracking and understand the coding review for you to create a deep sort tutorial in python. Get the coding and make sure your family members are safe at all times!

Ashutosh Saitwal
Ashutosh Saitwal

Ashutosh is the founder and director of the award winning KlearStack AI platform. You can catch him speaking at NASSCOM events around the world where he speaks and is an evangelist for RPA, AI, Machine Learning and Intelligent Document Processing.