In this project, first I Clone yolov5 repository : https://github.com/ultralytics/yolov5.git
Then I config in file utils.dataloders.py , I add 1 parameter is frame ( to define value of parameter FrameID ).
After that, I take [lấy] x this parameter and set it with the name "frameID" in file detect.py.
In this file, I generate variable "obj_dict" to save the information about (FrameID, Object’s class, Object’s bounding box, Confidence) of object and then save into a JSON file. As you see in this picture, I take information of bouding box, confidence score and class in "det", save it to each variable , and then save it into a "detections.json" file.
Additionally, this is the googledrive link : https://drive.google.com/drive/folders/1nDf7pkot72yT4gKh633G8E9ycgO4ShN_?usp=sharing of video result after we use YOLOv5 model with "yolov5s.pt" weights and confidence is 0.4.
And finally, the output JSON file has name "detections.json".