|
| 1 | + |
| 2 | +# Data preparation |
| 3 | +## Setup |
| 4 | +- You can optionally modify `MOTCHA_PATH` and `MOTSYNTH_PATH` and `OUTPUT_DIR` as your directories for you MOT17, MOTSynth, and you train/eval outputs at `configs/path_cfg.py`. |
| 5 | + |
| 6 | +## Downloading and preparing MOTSynth |
| 7 | + |
| 8 | +1. Download and extract all MOTSynth videos. This will take a while... |
| 9 | +``` |
| 10 | +MOTSYNTH_ROOT=$(python -c "from configs.path_cfg import MOTSYNTH_ROOT; print(MOTSYNTH_ROOT);") |
| 11 | +wget -P $MOTSYNTH_ROOT https://motchallenge.net/data/MOTSynth_1.zip |
| 12 | +wget -P $MOTSYNTH_ROOT https://motchallenge.net/data/MOTSynth_2.zip |
| 13 | +wget -P $MOTSYNTH_ROOT https://motchallenge.net/data/MOTSynth_3.zip |
| 14 | +
|
| 15 | +unzip $MOTSYNTH_ROOT/MOTSynth_1.zip -d $MOTSYNTH_ROOT |
| 16 | +unzip $MOTSYNTH_ROOT/MOTSynth_2.zip -d $MOTSYNTH_ROOT |
| 17 | +unzip $MOTSYNTH_ROOT/MOTSynth_3.zip -d $MOTSYNTH_ROOT |
| 18 | +
|
| 19 | +rm $MOTSYNTH_ROOT/MOTSynth_1.zip |
| 20 | +rm $MOTSYNTH_ROOT/MOTSynth_2.zip |
| 21 | +rm $MOTSYNTH_ROOT/MOTSynth_3.zip |
| 22 | +``` |
| 23 | +2. Extract frames from the videos you downloaded. Again, this will take while. |
| 24 | +``` |
| 25 | +python tools/anns/to_frames.py --motsynth-root $MOTSYNTH_ROOT |
| 26 | +
|
| 27 | +# You can now delete the videos |
| 28 | +rm -r $MOTSYNTH_ROOT/MOTSynth_1 |
| 29 | +rm -r $MOTSYNTH_ROOT/MOTSynth_2 |
| 30 | +rm -r $MOTSYNTH_ROOT/MOTSynth_3 |
| 31 | +``` |
| 32 | +3. Download and extract the annotations (in several formats): |
| 33 | +``` |
| 34 | +wget -P $MOTSYNTH_ROOT https://motchallenge.net/data/MOTSynth_coco_annotations.zip |
| 35 | +wget -P $MOTSYNTH_ROOT https://motchallenge.net/data/MOTSynth_mot_annotations.zip |
| 36 | +wget -P $MOTSYNTH_ROOT https://motchallenge.net/data/MOTSynth_mots_annotations.zip |
| 37 | +# Merged annotation files for ReID and detection trainings |
| 38 | +wget -P $MOTSYNTH_ROOT https://vision.in.tum.de/webshare/u/brasoand/motsynth/comb_annotations.zip |
| 39 | +
|
| 40 | +unzip $MOTSYNTH_ROOT/MOTSynth_coco_annotations.zip -d $MOTSYNTH_ROOT |
| 41 | +unzip $MOTSYNTH_ROOT/MOTSynth_mot_annotations.zip -d $MOTSYNTH_ROOT |
| 42 | +unzip $MOTSYNTH_ROOT/MOTSynth_mots_annotations.zip -d $MOTSYNTH_ROOT |
| 43 | +unzip $MOTSYNTH_ROOT/comb_annotations.zip -d $MOTSYNTH_ROOT |
| 44 | +
|
| 45 | +rm $MOTSYNTH_ROOT/MOTSynth_coco_annotations.zip |
| 46 | +rm $MOTSYNTH_ROOT/MOTSynth_mot_annotations.zip |
| 47 | +rm $MOTSYNTH_ROOT/MOTSynth_mots_annotations.zip |
| 48 | +rm $MOTSYNTH_ROOT/comb_annotations.zip |
| 49 | +``` |
| 50 | +**Note**: You can generate the mot, mots and combined annotation files yourself from the original coco format annotations with the scripts `tools/anns/generate_mot_format_files.py`, `tools/anns/generate_mots_format_files.py`, and `tools/anns/combine_anns.py`, respectively. |
| 51 | + |
| 52 | +After runnning these steps, your `MOTSYNTH_ROOT` directory should look like this: |
| 53 | +```text |
| 54 | +$MOTSYNTH_ROOT |
| 55 | +├── frames |
| 56 | + │-- 000 |
| 57 | + │ │-- rgb |
| 58 | + │ │ │-- 0000.jpg |
| 59 | + │ │ │-- 0001.jpg |
| 60 | + │ │ │-- ... |
| 61 | + │-- ... |
| 62 | +├── annotations |
| 63 | + │-- 000.json |
| 64 | + │-- 001.json |
| 65 | + │-- ... |
| 66 | +├── comb_annotations |
| 67 | + │-- split_1.json |
| 68 | + │-- split_2.json |
| 69 | + │-- ... |
| 70 | +├── mot_annotations |
| 71 | + │-- 000 |
| 72 | + │ │-- gt |
| 73 | + │ │ │-- gt.txt |
| 74 | + │ │-- seqinfo.ini |
| 75 | + │-- ... |
| 76 | +├── mots_annotations |
| 77 | + │-- 000 |
| 78 | + │ │-- gt |
| 79 | + │ │ │-- gt.txt |
| 80 | + │ │-- seqinfo.ini |
| 81 | + │-- ... |
| 82 | +
|
| 83 | +``` |
| 84 | + |
| 85 | + |
| 86 | +## Downloading and preparing MOT17 |
| 87 | +We will use MOT17 for both tracking and MOTS experiments, since MOTS20 sequences are a subset of MOT17 sequences. To download it, follow these steps: |
| 88 | + |
| 89 | +1. Download and extract it under `$MOTCHA_ROOT`. E.g.: |
| 90 | +``` |
| 91 | +MOTCHA_ROOT=$(python -c "from configs.path_cfg import MOTCHA_ROOT; print(MOTCHA_ROOT);") |
| 92 | +wget -P $MOTCHA_ROOT https://motchallenge.net/data/MOT17.zip |
| 93 | +unzip $MOTCHA_ROOT/MOT17.zip -d $MOTCHA_ROOT |
| 94 | +rm $MOTCHA_ROOT/MOT17.zip |
| 95 | +``` |
| 96 | +2. Download and extract COCO-format MOT17 annotations (or alternatively, you can generate them with `tools/anns/motcha_to_coco.py`). These are needed for evaluation in detection and reid trainings. |
| 97 | +``` |
| 98 | +wget -P $MOTCHA_ROOT https://vision.in.tum.de/webshare/u/brasoand/motsynth/motcha_coco_annotations.zip |
| 99 | +unzip $MOTCHA_ROOT/motcha_coco_annotations.zip -d $MOTCHA_ROOT |
| 100 | +rm $MOTCHA_ROOT/motcha_coco_annotations.zip |
| 101 | +``` |
| 102 | + |
| 103 | +After runnning these steps, your `MOTCHA_ROOT` directory should look like this: |
| 104 | +``` |
| 105 | +$MOTCHA_ROOT |
| 106 | +├── MOT17 |
| 107 | +| │-- train |
| 108 | +| │ │-- MOT17-02-DPM |
| 109 | +| │ │ │-- gt |
| 110 | +| │ │ │ |-- gt.txt |
| 111 | +| │ │ │-- det |
| 112 | +| │ │ │ |-- det.txt |
| 113 | +| │ │ |-- img1 |
| 114 | +| │ │ │ |-- 000001.jpg |
| 115 | +| │ │ │ |-- 000002.jpg |
| 116 | +| │ │ │ |-- ... |
| 117 | +| │ │ │-- seqinfo.ini |
| 118 | +| | |-- MOT17-02-FRCNN |
| 119 | +| │ │ │-- ... |
| 120 | +| | |-- ... |
| 121 | +| │-- test |
| 122 | +| │-- MOT17-01-DPM |
| 123 | +| │-- ... |
| 124 | +| |
| 125 | +|--motcha_coco_annotations |
| 126 | + │-- MOT17-02.json |
| 127 | + │-- ... |
| 128 | + │-- MOT17-train.json |
| 129 | +``` |
| 130 | +## ReID data |
| 131 | +**Note**: This is only needed if you want to train you own ReID model. |
| 132 | + |
| 133 | +To train and evaluate ReID models, we store the bounding-box cropped images of pedestrians in every 60th frame from both MOTSynth and MOT17, respectively. You can download these images here: |
| 134 | +``` |
| 135 | +# For MOT17 |
| 136 | +MOTCHA_ROOT=$(python -c "from configs.path_cfg import MOTCHA_ROOT; print(MOTCHA_ROOT);") |
| 137 | +wget -P $MOTCHA_ROOT https://vision.in.tum.de/webshare/u/brasoand/motsynth/motcha_reid_images.zip.zip |
| 138 | +unzip $MOTCHA_ROOT/motcha_reid_images.zip -d $MOTCHA_ROOT |
| 139 | +rm $MOTCHA_ROOT/motcha_reid_images.zip |
| 140 | +
|
| 141 | +# For MOTSynth |
| 142 | +MOTSYNTH_ROOT=$(python -c "from configs.path_cfg import MOTSYNTH_ROOT; print(MOTSYNTH_ROOT);") |
| 143 | +wget -P $MOTSYNTH_ROOT https://vision.in.tum.de/webshare/u/brasoand/motsynth/motsynth_reid_images.zip.zip |
| 144 | +unzip $MOTSYNTH_ROOT/motsynth_reid_images.zip -d $MOTSYNTH_ROOT |
| 145 | +rm $MOTSYNTH_ROOT/motsynth_reid_images.zip |
| 146 | +
|
| 147 | +``` |
| 148 | + |
| 149 | +Alternatively, you can directly generate these images locally by running: |
| 150 | +``` |
| 151 | +# For MOT17 |
| 152 | +python tools/anns/store_reid_imgs.py --ann-path $MOTCHA_ROOT/motcha_coco_annotations/MOT17-train.json |
| 153 | +
|
| 154 | +# For MOTSynth |
| 155 | +python tools/anns/store_reid_imgs.py --ann-path $MOTSYNTH_ROOT/comb_annotations/train_mini.json |
| 156 | +``` |
0 commit comments