Commit 718c73f0 authored by chenych's avatar chenych
Browse files

Modify README and add gen_data.py

parent 6a00812f
This diff is collapsed.
{
"info": {
"version": "1.0",
"year": 2020,
"contributor": "Mr.yang",
"date_created": "2018/08/21",
"github": "https://github.com/bleakie"
},
"licenses": [
{
"url": "http://creativecommons.org/licenses/by-nc-sa/2.0/",
"name": "Attribution-NonCommercial-ShareAlike License",
"id": 1
}
],
"images": [],
"annotations": [],
"categories": [
{
"supercategory": "face",
"id": 1,
"name": "face",
"keypoints": [
"left_eye",
"right_eye",
"nose",
"left_mouth",
"right_mouth"
]
}
]
}
\ No newline at end of file
# 模型唯一标识
modelCode = 440
# 模型名称
modelName=centerface_pytorch
# 模型描述
modelDescription=CenterFace是一种人脸检测算法,采用了轻量级网络mobileNetV2作为主干网络,结合特征金字塔网络(FPN)实现anchor free的人脸检测。
# 应用场景
appScenario=推理,训练,教育,交通,公安,医疗
# 框架类型
frameType=PyTorch
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
......@@ -31,17 +31,16 @@ 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, 'WIDER_train/images') # 训练图片所在地址
self.img_dir = os.path.join(self.data_dir, 'images/train') # 训练图片所在地址
_ann_name = {'train': 'train', 'val': 'val'}
if split == 'val':
self.annot_path = os.path.join(
self.data_dir, 'annotations',
'{}_wider_face.json').format(_ann_name[split])
self.data_dir, 'labels',
'{}_face.json').format(_ann_name[split])
else:
self.annot_path = os.path.join(
self.data_dir, 'annotations',
'{}_wider_face.json').format(_ann_name[split])
self.data_dir, 'labels',
'{}_face.json').format(_ann_name[split])
self.max_objs = 32
self._data_rng = np.random.RandomState(123)
self._eig_val = np.array([0.2141788, 0.01817699, 0.00341571],
......
......@@ -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(
......@@ -92,7 +92,7 @@ class opts(object):
# train
self.parser.add_argument('--lr', type=float, default=1.25e-4,
help='learning rate for batch size 32.')
self.parser.add_argument('--lr_step', type=str, default='30,80',
self.parser.add_argument('--lr_step', type=str, default='90,120',
help='drop learning rate by 10.')
self.parser.add_argument('--num_epochs', type=int, default=140,
help='total training epochs.')
......
......@@ -114,8 +114,8 @@ if __name__ == '__main__':
debug = 0
model_path = '../models/model_best.pth' # or your model path
# 单图测试
# test_img(model_path, debug)
test_img(model_path, debug)
# 视频测试
# test_vedio(model_path, debug)
# WIDER_val 数据集测试
test_wider_Face(model_path, debug)
# test_wider_Face(model_path, debug)
#!/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