deep_sort icon indicating copy to clipboard operation
deep_sort copied to clipboard

How can I generate my own det.txt file?

Open sandeep5522 opened this issue 5 years ago • 8 comments

I am trying to apply this on my custom images for that how can I generate det.txt file. Thanks in advance.

sandeep5522 avatar Apr 25 '19 07:04 sandeep5522

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)

nwojke avatar Apr 30 '19 09:04 nwojke

@sandeep5522 I have the same issue. Did you find any solution to this issue?

Thanks in advance.

SharvariN-Lab58 avatar Jul 11 '19 19:07 SharvariN-Lab58

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

mshahriarish avatar Sep 06 '19 07:09 mshahriarish

@sandeep5522 I have used this repo on custom videos. I followed the following steps. Hope it will help you too

  1. Convert your video(s) into frames and save it in a folder img1 with structure like parent_folder/child_folder/img1.
  2. Create another folder with name det at same level of img1.
  3. 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 above frame_count, -1, top_left_x, top_left_y, width, height, score, -1, -1, -1
  4. Run the following command in root deep_sort. It will generate .npy file python tools/generate_detections.py --model=resources/networks/mars-small128.pb \ --mot_dir=parent_folder/child_folder --output_dir=custom/detections
  5. Run the following command in root deep_sort to get the output video of tracking python 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 avatar Mar 12 '20 13:03 InzamamAnwar

@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.

utkutpcgl avatar May 18 '20 14:05 utkutpcgl

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.

InzamamAnwar avatar May 19 '20 15:05 InzamamAnwar

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?

utkutpcgl avatar May 20 '20 08:05 utkutpcgl

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 ...

loophole64 avatar Mar 24 '21 20:03 loophole64