This project aims to detect various types of vehicles using thermal cameras installed as surveillance sensors in streets. It employs a tracking-by-detection scheme to track the detected objects and subsequently counts the number of unique objects passing through each user-defined polygon.
For object detection, we utilized YOLO-NAS
fine-tuned on the aauRainSnow
dataset ([Download Link][License Link]). Codes for generating the appropriate YOLO annotations from the dataset and training the object detector are included. Additionally, the trained weights are also provided.
For multi-object tracking, we utilize SORT
(Simple, Online, and Real-time Tracking of multiple objects), which has demonstrated promising results in this task.
For working with images and videos install: OpenCV For using and training object detector install these two packages: PyTorch Super Gradients For tracking install: SORT Python
The link to download trained model weights is located in checkpoint-object-detection/checkpoint_link.txt
. However, if you want to train it yourself or train with a new set of hyperparameters, follow these instructions:
- Download the original
aauRainSnow
dataset by referring to the instructions indataset/data-link.txt
. - Execute
convert_coco_to_yolov7_annotation.py
to create the appropriate YOLO annotation format from the original dataset. - Finally, run the code in
finetuning_YOLO_NAS_thermal_camera.ipynb
to train the object detector.
For tracking and unique object counting in specific regions, you can use the provided configuration file named config_files
. Configuration files such as config-co-*.json
are designed for both tracking and counting tasks, while files like config-tr-*.json
are solely for tracking and do not involve counting.
Place input videos corresponding to the configuration files in the inputs
folder, following the instructions outlined in inputs/input-data.txt
.
Feel free to create similar configuration files with different hyperparameters for object detection, tracking, input videos, and regions of interest to customize the counting of unique objects that pass through them.
-
Put the path of the configuration file that you want to use in
config_file_path.json
. -
Run the code with
python run.py
.