Summary
Options to improve performance of the Multi Camera Multi Target Python Demo
Description
- The _compute_mct_distance_matrixfunction in Multi-Camera Multi-Target Python Demo checks the cosine distance between each and every track to each other across multiple cameras.
- A large number of tracks would cost hours to days to check the tracks.
Resolution
Option 1: Validate the model by evaluating model performance on unseen data in PyTorch.
-
Use the function:
with torch.no_grad():
for i,data in enumerate(X_test):
y_val = model.forward(data) #this function is to grab prediction
- The with torch.no_grad() function will impact the auto gradient engine and essentially deactivate it. The program won't emphasize backpropagation since this is just about evaluating the model, thus, there's no requirement to change weight or biases, etc. Hence, it helps to reduce memory usage and speed up computation. However, this is only applicable to the test dataset, but not the training dataset.
Option 2: Accelerate the inference of deep learning models using Post-Training Optimization (POT).
- POT uses Low Precision Optimization which helps to reduce the inferencing time. POT does not require a training dataset or a pipeline as POT can be applied without model retraining or fine-tuning.
- Refer to Use Post-Training Optimization Tool Command-Line Interface for the step-by-step implementation.