amazon Rekognition People Routing is a machine learning (ML)-based capability in amazon Rekognition Video that users can use to understand where, when, and how each person moves in a video. This capability can be used for multiple use cases, such as understanding:
- Retail analysis – Customer flow in the store and identification of high traffic areas.
- Sports analytics – Player movements across the field or court.
- industrial safety – Movement of workers in work environments to promote compliance with safety protocols.
After careful consideration, we made the decision to suspend the Rekognition people route on October 31, 2025. New customers will not be able to access the capacity starting October 24, 2024, but existing customers will be able to use the capacity normally until October 31. , 2025.
This post discusses a workaround for Rekognition's people routing and how you can implement this solution in your applications.
Alternatives to Rekognition people pathing
An alternative to amazon Rekognition's people path combines open source machine learning model YOLOv9which is used for object detection, and the open source ByteTrack algorithm, which is used for multiple object tracking.
YOLO9 and ByteTrack Overview
YOLOv9 is the latest in the series of YOLO object detection models. It uses a specialized architecture called Generalized Efficient Layer Aggregation Network (GELAN) to analyze images efficiently. The model divides an image into a grid, quickly identifying and locating objects in each section in a single pass. It then refines its results using a technique called programmable gradient information (PGI) to improve accuracy, especially for easily overlooked objects. This combination of speed and accuracy makes YOLOv9 ideal for applications that need fast and reliable object detection.
byte track is an algorithm for tracking multiple moving objects in videos, such as people walking through a store. What makes it special is how it handles objects that are both simple and difficult to detect. Even when someone is partially hidden or in a crowd, ByteTrack can often still track them. It is designed to be fast and accurate, and works well even when there are many people to track simultaneously.
When you combine YOLOv9 and ByteTrack for people routing, you can review people's movements in video frames. YOLOv9 provides person detections in every video frame. ByteTrack takes these detections and associates them between frames, creating consistent tracks for each individual, showing how people move through the video over time.
Example code
The following code example is a Python script that can be used as an AWS Lambda function or as part of your pipeline. You can also implement YOLOv9 and ByteTrack for inference using amazon SageMaker. SageMaker offers several options for model deployment, such as real-time inference, asynchronous inference, serverless inference, and batch inference. You can choose the appropriate option based on your business requirements.
Here's a high-level breakdown of how the Python script runs:
- Load the YOLOv9 model – This model is used to detect objects in each frame.
- Start ByteTrack tracker – This tracker assigns unique IDs to objects and tracks them across frames.
- Iterate the video frame by frame – For each frame, the script iterates by detecting objects, following the path, and drawing bounding boxes and labels around them. All of this is saved in a JSON file.
- Processed video output – The final video is saved with all detected and tracked objects, annotated in each frame.
Validation
We use the following video to show this integration. The video shows a football practice session, where the quarterback is initiating a play.
The following table shows an example of the content of the JSON file with people tracking results by timestamp.
timestamp | IndexPerson | bounding box… | |||
Height | Left | Above | Broad | ||
0 | 42 | 0.51017 | 0.67687 | 0.44032 | 0.17873 |
0 | 63 | 0.41175 | 0.05670 | 0.3148 | 0.07048 |
1 | 42 | 0.49158 | 0.69260 | 0.44224 | 0.16388 |
1 | 65 | 0.35100 | 0.06183 | 0.57447 | 0.06801 |
4 | 42 | 0.49799 | 0.70451 | 0.428963 | 0.13996 |
4 | 63 | 0.33107 | 0.05155 | 0.59550 | 0.09304 |
4 | 65 | 0.78138 | 0.49435 | 0.20948 | 0.24886 |
7 | 42 | 0.42591 | 0.65892 | 0.44306 | 0.0951 |
7 | 63 | 0.28395 | 0.06604 | 0.58020 | 0.13908 |
7 | 65 | 0.68804 | 0.43296 | 0.30451 | 0.18394 |
The following video shows the results with the people who follow the production.
Other open source solutions for people routing
Although YOLOv9 and ByteTrack offer a powerful combination for people routing, it is worth considering other open source alternatives:
- Deep sort – A popular algorithm that combines deep learning features with traditional tracking methods.
- FairMOT – Integrates object detection and re-identification into a single network, giving users the ability to track objects in busy scenes
These solutions can be effectively implemented using amazon SageMaker for inference.
Conclusion
In this post, we describe how you can try and implement YOLOv9 and Byte Track as an alternative to the Rekognition people route. Combined with AWS tooling offerings such as AWS Lambda and amazon SageMaker, you can deploy these open source tools for your applications.
About the authors
Fangzhou Cheng is a Senior Applied Scientist at AWS. Create scientific solutions for AWS Rekgnition and AWS Monitron to provide customers with next-generation models. His areas of focus include generative ai, computer vision, and time series data analysis.
Marcel Pividal is a Senior ai Services SA at the Global Specialist Organization, bringing more than 22 years of experience in transforming complex business challenges into innovative technology solutions. As a thought leader in generative ai implementation, he specializes in developing secure and compliant ai architectures for enterprise-scale deployments across multiple industries.