"docs/vscode:/vscode.git/clone" did not exist on "34f8a4b924d8253f459fc22665a3f3a232ef44ff"
Commit e0491117 authored by chenych's avatar chenych
Browse files

Modify the size in train and some file path

parents 718c73f0 c9fac124
Pipeline #608 failed with stages
in 0 seconds
......@@ -4,11 +4,10 @@
## 模型结构
CenterFace是一种人脸检测算法,采用了轻量级网络mobileNetV2作为主干网络,结合特征金字塔网络(FPN)实现anchor free的人脸检测。
![Architecture of the CenterFace](Architecture of the CenterFace.png)
## 算法原理
CenterFace模型是一种基于单阶段人脸检测算法,作者借鉴了CenterNet的思想,将人脸检测转换为标准点问题,根据人脸中心点来回归人脸框的大小和五个标志点。
![Architecture of the CenterFace](Architecture of the CenterFace.png)
## 环境配置
### Docker(方法一)
......@@ -100,15 +99,25 @@ WIDER_FACE:http://shuoyang1213.me/WIDERFACE/index.html
│ └── 61--Street_Battle
```
<<<<<<< HEAD
2. 如果是使用WIDER_train、WIDER_val数据, 可直接将./datasets/labels/下的train_wider_face.json重命名为train_face.json, val_wider_face.json重命名为val_face.json即可,无需进行标注文件格式转换;
反之,需要将训练图片/验证图片对应的人脸关键点标注信息文件train.txt/val.txt,放置于 ./datasets/annotations/下(train存放训练图片的标注文件,val存放验证图片的标注文件),存放目录结构如下:
=======
2. 如果是使用WIDER_train数据, 可直接将./datasets/labels/下的train_wider_face.json重命名为train_face.json即可,无需进行标注文件格式转换;反之,需要将训练图片对应的人脸关键点标注信息文件(xxxx.txt),放置于 ./datasets/annotations/下(train存放训练图片的标注文件,val存放验证图片的标注文件),存放目录结构如下:
>>>>>>> c9fac124caf657ec86fd6a58ca90e1da5f88f6cb
```
├── annotations
│ ├── train
<<<<<<< HEAD
│ ├── train.txt
│ ├── val
│ ├── val.txt
=======
│ ├── xxx.txt
│ ├── val
│ ├── xxx.txt
>>>>>>> c9fac124caf657ec86fd6a58ca90e1da5f88f6cb
```
特别地,标注信息的格式为:
......@@ -133,7 +142,11 @@ cd ./datasets
python gen_data.py
```
<<<<<<< HEAD
执行完成后会在./datasets/labels下生成训练数据的标注文件 train_face.json、val_face.json
=======
执行完成后会在./datasets/labels下生成训练数据的标注文件 train_face.json
>>>>>>> c9fac124caf657ec86fd6a58ca90e1da5f88f6cb
## 训练
......
......@@ -31,8 +31,9 @@ class FACEHP(data.Dataset):
self.acc_idxs = [1, 2, 3, 4]
self.data_dir = opt.data_dir
self.img_dir = os.path.join(self.data_dir, 'images/train') # 训练图片所在地址
_ann_name = {'train': 'train', 'val': 'val'}
self.img_dir = os.path.join(self.data_dir, f'images/{_ann_name[split]}') # 训练图片所在地址
print('===>', self.img_dir)
if split == 'val':
self.annot_path = os.path.join(
self.data_dir, 'labels',
......
#!/usr/bin/env bash
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
python main.py --input_h 512 --input_w 512 --batch_size 8 --lr 5e-4 --data_dir ../datasets/
\ No newline at end of file
#!/usr/bin/env bash
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
python main.py --input_h 512 --input_w 512 --batch_size 8 --lr 5e-4 --data_dir ../datasets/ --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