deep_sort
deep_sort copied to clipboard
How can I generate my own det.txt file?
I am trying to apply this on my custom images for that how can I generate det.txt file. Thanks in advance.
Head over to the MOT Challenge website and search for the file format specification. I am not sure where it is out of my head right now. It will be something like this:
# format: frame id, track id, bbox (x, y, w, h), care_flag, world (x, y, z)
@sandeep5522 I have the same issue. Did you find any solution to this issue?
Thanks in advance.
I am trying to use your code. However, I do not know what is this care_flag. What is obvious is that this number is not part on MOT challenge. In MOT challenge instead of this number we have confidence which is of course less than one. However, in your dataset this number is anything possitive or negative. Can you please explain shortly what is this care_flag? Thank you so much in advance. Regards
@sandeep5522 I have used this repo on custom videos. I followed the following steps. Hope it will help you too
- Convert your video(s) into frames and save it in a folder
img1
with structure likeparent_folder/child_folder/img1
. - Create another folder with name
det
at same level ofimg1
. - Run your favorite model for object (person/pedestrian) detection to generate bounding boxes for whole video. You should write these bounding boxes in the following format in a comma separated text file in
det
folder created aboveframe_count, -1, top_left_x, top_left_y, width, height, score, -1, -1, -1
- Run the following command in root
deep_sort
. It will generate.npy
filepython tools/generate_detections.py --model=resources/networks/mars-small128.pb \ --mot_dir=parent_folder/child_folder --output_dir=custom/detections
- Run the following command in root
deep_sort
to get the output video of trackingpython deep_sort_app.py --sequence_dir=parent_folder/child_folder/img1 \ --detection_file=custom/detections/custom_video.npy --min_confidence=0.3 --nn_budget=100 \ --display=True
Let me know if this works for you. Good Luck!
@InzamamAnwar could you please explain the "-1"s in the detections? How can I produce the bounding boxes by using Yolo? Also, I wanted to ask if anyone has succeeded with @InzamamAnwar 's method? Thanks.
Q1) Could you please explain the "-1"s in the detections?
Ans) -1
are part of formatting used in MOT 16 challenge. Read this article section 3.3, Data Format
Q2) How can I produce the bounding boxes by using Yolo?
Ans) The question is little vague. Kindly explain a little about what do you mean by how?
. In my case I used TensorFlow's Object Dectection API and used pre-trained model provided by API.
I am trying to train deepsort on my custom dataset and I am trying to avoid rewriting a python file similar to the ones in the dataset directory in the cosine metric learning. Also, I thought that I could auto-label the cars by using a detection method, however, I noticed I have to label them on my own. So, the 2. question I asked was pointless.
Now, I try to understand the MARS and Market-1501 data format, so that I can use the available dataloader scripts in the cosine_metric_learning page. However, if it does not work, I will have to re-write a dataloader, similar to the ones in https://github.com/nwojke/cosine_metric_learning/tree/master/datasets. Any suggestion is appreciated, I guess re-implementing seems easy though.
Thanks for the help @InzamamAnwar . Also, can anyone help with the default data format of MARS or Market-1501?
From MOT website:
Data Format p> The file format should be the same as the ground truth file, which is a CSV text-file containing one object instance per line. Each line must contain 10 values:
<frame>, <id>, <bb_left>, <bb_top>, <bb_width>, <bb_height>, <conf>
The world coordinates x,y,z are ignored for the 2D challenge and can be filled with -1. Similarly, the bounding boxes are ignored for the 3D challenge. However, each line is still required to contain 10 values.
All frame numbers, target IDs and bounding boxes are 1-based. Here is an example:
1, -1, 794.27, 247.59, 71.245, 174.88, 4.56 1, -1, 1648.1, 119.61, 66.504, 163.24, 0.32 1, -1, 875.49, 399.98, 95.303, 233.93, -1.34 ...