Skip to content

Commit

Permalink
Merge pull request #12 from Media-Smart/widerface-dev
Browse files Browse the repository at this point in the history
update data preparation
  • Loading branch information
hxcai authored Dec 2, 2020
2 parents 93a27c1 + b787212 commit a9926db
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 7 deletions.
40 changes: 33 additions & 7 deletions configs/trainval/tinaface/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,51 @@ Providing a strong but simple baseline method for face detection named TinaFace.

![1](./imgs/model.png)

## Data
## Data Preparation

### WIDER FACE
a. Convert raw data to PASCAL-VOC format by [this tool](https://github.com/akofman/wider-face-pascal-voc-annotations)
a. Convert raw data to PASCAL-VOC format by this [tool](https://github.com/akofman/wider-face-pascal-voc-annotations)

b. Get *Annotations* folder generated by last step and change the folder structure as follow
```plain
vedadet
├── vedadet
├── vedacore
├── tools
├── configs
├── data
│ ├── WIDERFace
│ │ ├── WIDER_train
│ │ │ ├── 0--Parade
│ │ │ ├── ......
│ │ │ ├── 61--Street_Battle
│ │ │ ├── Annotations
│ │ ├── WIDER_val
│ │ │ ├── 0--Parade
│ │ │ ├── ......
│ │ │ ├── 61--Street_Battle
│ │ │ ├── Annotations
```
where *0--Parade*, *61--Street_Battle* and etc. folders contain images.

c. Run the following code to generate txt file of xmls.
```shell
cd ${vedadet_root}
bash configs/trainval/tinaface/gen_xml_name_txt.sh
```

## Train
a. Follow the official instructions on [vedadet](https://github.com/Media-Smart/vedadet)
Follow the official instructions on [vedadet](https://github.com/Media-Smart/vedadet)

## Evaluation
a. Back to `${vedadet_root}`

b. Run following instruction
```shell
cd ${vedadet_root}
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](http://mmlab.ie.cuhk.edu.hk/projects/WIDERFace/support/eval_script/eval_tools.zip) to evaluate the WIDERFACE performance.

## Infer
a. Follow the official instructions on [vedadet](https://github.com/Media-Smart/vedadet)
Follow the official instructions on [vedadet](https://github.com/Media-Smart/vedadet)

## Results and Models

Expand Down
3 changes: 3 additions & 0 deletions configs/trainval/tinaface/gen_xml_name_txt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

ls -l data/WIDERFace/WIDER_train/Annotations | grep "^-" | awk '{print $9}' | cut -d '.' -f 1 > data/WIDERFace/WIDER_train/train.txt
ls -l data/WIDERFace/WIDER_val/Annotations | grep "^-" | awk '{print $9}' | cut -d '.' -f 1 > data/WIDERFace/WIDER_val/val.txt

0 comments on commit a9926db

Please sign in to comment.