Media-Smart / vedadet

A single stage object detection toolbox based on PyTorch
Apache License 2.0
498 stars 128 forks source link

Question about ann_file from ${VEDADET_DIR}/configs/trainval/tinaface/tinaface.py for training or validation on WIDER FACE #11

Closed swoook closed 3 years ago

swoook commented 3 years ago

Hi! First of all, thank you for your great work on single stage object detection!

I'm currently trying to reproduce detection results of TinaFace on WIDER FACE val written in the paper.

However, I have no idea about what file path I must write in ann_file from \${VEDADET_DIR}/configs/trainval/tinaface/tinaface.py for WIDER FACE training or validation.

At fisrt, I suspected it should be wider_face_train_bbx_gt.txt or wider_face_val_bbx_gt.txt from wider_face_split.zip.

However, it seems fileio.list_from_file from \${VEDADET_DIR}/vedadet/datasets/widerface.py doesn't return image ids appropriately.

According to the implementation of fileio.list_from_file, the appropriate file for ann_file seems to be a file containing only the image file name, such as wider_face_test_filelist.txt in from wider_face_split.zip.

Is it correct? Or am I missing something?

hxcai commented 3 years ago

@swoook please see this for data preparing.

swoook commented 3 years ago

Thank you for your response :)

However, I already followed the instructions from Data section.

.
├── 0_Parade_marchingband_1_1004.xml
├── 0_Parade_marchingband_1_1045.xml
├── 0_Parade_marchingband_1_104.xml
├── 0_Parade_marchingband_1_139.xml
├── 0_Parade_marchingband_1_147.xml
├── 0_Parade_marchingband_1_149.xml
├── 0_Parade_marchingband_1_156.xml
├── 0_Parade_marchingband_1_172.xml
├── 0_Parade_marchingband_1_188.xml
...

My question is: What is the appropriate file for ann_file from configs/trainval/tinaface/tinaface.py for WIDER FACE validation?

        ann_file=data_root + 'WIDER_val/val.txt',

Maybe it would be better to explain my issue step by step.

Evaluation section doesn't provide any information about config.

Evaluation

a. Back to ${vedadet_root}

b. Run following instruction

python config/trainval/tinaface/test_widerface.py configs/trainval/tinaface/tinaface.py weight_path

widerface txt file will be generated at ${vedadet_root}/eval_dirs/tmp/tinaface/, and then download the eval_tool to evaluate the WIDERFACE performance.

But Training and Infer sections suggest to follow the official instructions on vedadet for training and inference, respectively.

Train

a. Follow the official instructions on vedadet

And vedadet provides configs/trainval/retinanet/retinanet.py as an example for config.

Train

a. Config

Modify some configuration accordingly in the config file like configs/trainval/retinanet.py

In configs/trainval/retinanet/retinanet.py, ann_file is instances_train2017.json by default.

        ann_file=data_root + 'annotations/instances_train2017.json',

In configs/trainval/tinaface/tinaface.py, ann_file is val.txt by default.

        ann_file=data_root + 'WIDER_val/val.txt',

However, val.txt isn't provided by WIDER FACE or akofman/wider-face-pascal-voc-annotations.

And as I mentioned before, wider_face_val_bbx_gt.txt seems to be not appropriate for ann_file.

# wider_face_val_bbx_gt.txt
0--Parade/0_Parade_marchingband_1_465.jpg
126
345 211 4 4 2 0 0 0 2 0 
331 126 3 3 0 0 0 1 0 0 
250 126 3 4 2 0 0 0 2 0 
221 128 4 5 0 0 0 1 0 0 
427 116 3 4 2 0 0 0 2 0 
393 79 3 4 0 0 0 1 0 0 
373 119 3 4 2 0 0 1 2 0 
90 225 6 5 2 0 0 1 2 0 
...

debug-img-ids

I think I should create val.txt which contains only the image file name, such as wider_face_test_filelist.txt from wider_face_split.zip myself.

# wider_face_test_filelist.txt
0--Parade/0_Parade_marchingband_1_737.jpg
0--Parade/0_Parade_marchingband_1_494.jpg
0--Parade/0_Parade_Parade_0_338.jpg
0--Parade/0_Parade_marchingband_1_533.jpg
0--Parade/0_Parade_marchingband_1_62.jpg
0--Parade/0_Parade_marchingband_1_184.jpg
0--Parade/0_Parade_marchingband_1_120.jpg
...

Is it correct?

mike112223 commented 3 years ago

@swoook we update the details for data preparation, please check this.

swoook commented 3 years ago

Thanks a lot! 😄