Commit c9fac124 authored by chenych's avatar chenych
Browse files

Add labels of wider face datasets

parent 79a9d52f
Pipeline #607 canceled with stages
*.mdb
*.pth
*.tar
*.txt
*.ipynb
*.zip
*.eps
......
......@@ -100,7 +100,7 @@ WIDER_FACE:http://shuoyang1213.me/WIDERFACE/index.html
│ └── 61--Street_Battle
```
2. 如果是使用WIDER_train数据, 可直接将./datasets/labels/train下的train_wider_face.json重命名为train_face.json即可,无需进行标注文件格式转换;反之,需要将训练图片对应的人脸关键点标注信息文件(xxxx.txt),放置于 ./datasets/annotations/下(train存放训练图片的标注文件,val存放验证图片的标注文件),存放目录结构如下:
2. 如果是使用WIDER_train数据, 可直接将./datasets/labels/下的train_wider_face.json重命名为train_face.json即可,无需进行标注文件格式转换;反之,需要将训练图片对应的人脸关键点标注信息文件(xxxx.txt),放置于 ./datasets/annotations/下(train存放训练图片的标注文件,val存放验证图片的标注文件),存放目录结构如下:
```
├── annotations
......@@ -118,17 +118,18 @@ x, y, w, h, left_eye_x, left_eye_y, flag, right_eye_x, right_eye_y, flag, nose_x
```
举个例子:
train_keypoints_widerface.txt是wider_face训练数据集的标注信息
```
# 0--Parade/0_Parade_marchingband_1_849.jpg
449 330 122 149 488.906 373.643 0.0 542.089 376.442 0.0 515.031 412.83 0.0 485.174 425.893 0.0 538.357 431.491 0.0 0.82
...
```
3. 生成训练所需的json格式标注数据:
```
cd ./datasets
python gen_data.py --mode train
python gen_data.py
```
执行完成后会在./datasets/labels下生成训练数据的标注文件 train_face.json
......
This diff is collapsed.
......@@ -209,6 +209,7 @@ parser = argparse.ArgumentParser()
# basic experiment setting
parser.add_argument('--mode', default='train',
help='Please input train or val')
parser.add_argument('--txtPath', default='./annotations/train/train_keypoints_widerface.txt')
opt = parser.parse_args()
......@@ -216,7 +217,7 @@ if __name__ == "__main__":
ROOT_PATH = './'
label_type = opt.mode
img_path = os.path.join(ROOT_PATH, 'images', f'{label_type}')
txt_path = os.path.join(ROOT_PATH, 'annotations', f'{label_type}/{label_type}.txt')
txt_path = opt.txtPath
save_landmark_path = txt_path[:txt_path.rfind('/')]
save_landmark_path = os.path.join(
save_landmark_path, f'landmark_{label_type}.txt')
......
onnx==1.14.0
Torch==1.13.1
TorchVision==0.14.1
numpy>=1.18.1
Pillow>=7.2.0
pycocotools>=2.0.2
opencv-python==4.1.2.30
scipy
progress
Cython
tqdm
IPython
numba==0.58.1
......@@ -24,7 +24,7 @@ class opts(object):
'2: show the network output features'
'3: use matplot to display' # useful when lunching training with ipython notebook
'4: save all visualizations to disk')
self.parser.add_argument('--demo', default='/path/WIDER_train/images/0--Parade/0_Parade_marchingband_1_80.jpg',
self.parser.add_argument('--demo', default='../datassets/images/train/0--Parade/0_Parade_marchingband_1_512.jpg',
help='path to image/ image folders/ video. '
'or "webcam"')
self.parser.add_argument(
......
#!/usr/bin/env bash
python main.py --input_h 800 --input_w 800 --batch_size 16 --lr 6.25e-5 --load_model /path/of/model_best.pth --data_dir /your/WIDER_train/dir/path
\ No newline at end of file
python main.py --input_h 514 --input_w 514 --batch_size 8 --lr 5e-4 --data_dir ../datasets/images/train/
\ No newline at end of file
#!/usr/bin/env bash
python main.py --input_h 800 --input_w 800 --batch_size 16 --lr 6.25e-5 --gpus 0,1 --load_model /path/of/model_best.pth --data_dir /your/WIDER_train/dir/path
\ No newline at end of file
python main.py --input_h 514 --input_w 514 --batch_size 8 --lr 5e-4 --data_dir ../datasets/images/train/ --gpus 0,1
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment