Deep Sort
Deep Sort
DeepSORT is an extension of the SORT (Simple Online and Realtime Tracking) algorithm.
While SORT is a tracking algorithm based on Kalman Filters and the Hungarian Algorithm,
DeepSORT improves upon it by incorporating deep learning to re-identify vehicles, even if
they are temporarily occluded (blocked) or if their appearance changes due to lighting,
angle, or other factors.
DeepSORT uses both motion-based tracking (using Kalman filters) and appearance-based
tracking (using a neural network to extract features from the vehicle).
2. Tracking Initialization:
o The initial bounding box from YOLO (the location of the vehicle) is input into
the Kalman filter (used in DeepSORT for prediction).
o DeepSORT uses a Kalman filter to predict the next position of each vehicle in
the next frame based on its current speed and trajectory.
o This helps maintain the vehicle’s track even if the vehicle temporarily
disappears from view or is occluded by another object.
o While the Kalman filter tracks based on motion (position and velocity),
DeepSORT also uses a deep convolutional neural network (CNN) to extract
appearance features from each vehicle.
o These feature vectors are stored and used for re-identifying vehicles across
frames.
o Even if a vehicle is momentarily blocked or occluded, DeepSORT can re-
identify it once it reappears, based on its unique appearance features.
6. Track Management:
Terminating tracks for vehicles that have left the scene or are no
longer detected.
7. Tracking Output:
o After processing the frame, DeepSORT provides the vehicle ID, along with the
updated position (bounding box coordinates), for each tracked vehicle.
o This allows you to know which vehicle is parked in which spot and track its
movement over time.
1. Kalman Filter:
o Purpose: Predict the next position of a vehicle based on its current position
and velocity.
o How it helps: This allows DeepSORT to re-identify vehicles even if they are
occluded or temporarily leave the camera's field of view.
3. Hungarian Algorithm:
o How it helps: Ensures that vehicles are properly assigned to their correct
tracks, reducing errors when vehicles are close together.
4. Track Management:
o Purpose: Maintain an active list of all vehicle tracks, handle new detections,
and delete tracks when vehicles exit the scene.
o How it helps: Keeps your system organized and ensures that vehicle IDs are
consistent across frames.
1. Real-time Tracking:
2. High Accuracy:
o DeepSORT ensures that each vehicle is consistently assigned the same unique
ID, even if the vehicle temporarily disappears from the camera’s view.
o Since YOLO provides accurate vehicle detections, DeepSORT can use these
detections to ensure that vehicles are tracked across frames efficiently, which
is essential for your smart parking system to know exactly where each vehicle
is parked.
How to Integrate DeepSORT with YOLO in Your Project:
1. YOLO Detection:
o Use YOLO to detect vehicles in each frame and get the bounding boxes
(coordinates) for each vehicle.
o Example: Use OpenCV to load YOLO and perform object detection on each
frame of the video.
2. Initialize DeepSORT:
o Use the output from YOLO (vehicle bounding boxes) as input to DeepSORT.
Initialize the tracking system with the bounding boxes from YOLO.
3. Tracking Vehicles:
o In each new frame, the bounding boxes from YOLO will be passed to
DeepSORT, which will predict vehicle movements and keep track of their
positions.
o DeepSORT will assign unique IDs to vehicles and maintain tracking over time.
o Based on the vehicle IDs and their tracked positions, you can update parking
spot statuses (vacant/occupied) in your system.
In Summary:
DeepSORT is crucial for your smart vehicle parking system because it ensures that vehicles
are continuously tracked across frames, even if they are temporarily occluded or leave the
camera’s field of view. By combining motion-based (Kalman filter) and appearance-based
(CNN) tracking, DeepSORT helps in maintaining the vehicle's identity, ensuring accurate
parking spot allocation, and enabling a smooth and reliable real-time vehicle tracking
process.