Commit 79a9d52f authored by chenych's avatar chenych
Browse files

Modify README and add gen_data.py

parent 6a00812f
This diff is collapsed.
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
......@@ -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],
......
......@@ -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)
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