Train and Deploy Multiple Object Tracking Model with Amazon SageMaker

Multiple Object Tracking or MOT estimates a bounding box and ID for each pre-defined object in videos or consecutive frames, which has been used in tasks such as live sports, manufacturing, surveillance, and traffic monitoring. In the past, the high latency caused by the limitation of hardware and complexity of ML-based tracking algorithm is a major obstacle for its application in the industry. The state-of art algorithm FairMOT has reached the speed of about 30FPS on the MOT challenge datasets, which helps MOT find its way in many industrial scenarios.

This post shows how to train and deploy the state-of-art MOT algorithm FairMOT model with Amazon SageMaker.

Prerequisites

Running Costs

  • one SageMaker notebook on ml.t3.medium in us-east-1 region: $0.05 per hour, (250 hours free Tier usage per month for the first 2 months)
  • one training job on ml.p3.16xlarge in us-east-1 region takes 3 hours, total training cost for each training job:$85
  • one endpoint on ml.p3.2xlarge in us-east-1 region: $3.825 per hour
  • one SageMaker processing job on ml.p3.2xlarge in us-east-1 region: $3.825 per hour
  • Assuming you run one training job with the default parameters, test the real time inference and batch inference with the default test data, and delete inference endpoint once finishing test, totally it costs less than $95.

Training

To tune hyperparameters with Amazon SageMaker Hyperparameter Jobs, we modified the original training script to validate the model during training and set the validation loss as the objective metric. Currently our project only supports model training on a single instance.

Open fairmot-training.ipynb and run the cells step by step. It will take 3 hours to complete one training job. When performing hyperparameter tuning job, total run time will be about: Maximum total number of training jobs x Time on one training job / Maximum number of parallel training jobs.

Serving

We provide two ways of deploying the trained model: real time inference with endpoint and batch inference.

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.