1 有人/无人分类模型

1.1 数据下载

预训练模型
推理模型

1.2 静态图预测

python deploy/python/predict_cls.py -c deploy/configs/PULC/person_exists/inference_person_exists.yaml -o Global.use_gpu=False -o Global.inference_model_dir=models/PULC_person_exists -o Global.infer_imgs=deploy/images/PULC/person_attribute/

# 输出,其中,someone 表示该图里存在人,nobody 表示该图里不存在人。
090004.jpg:     class id(s): [0], score(s): [0.58], label_name(s): ['nobody']
090007.jpg:     class id(s): [1], score(s): [0.59], label_name(s): ['someone']

2 安全帽分类模型

2.1 数据下载

预训练模型
推理模型

2.2 动态图预测

python tools/infer.py -c ppcls/configs/PULC/safety_helmet/PPLCNet_x1_0.yaml -o Global.device=cpu -o Global.checkpoints=models/safety_helmet_pretrained -o Infer.infer_imgs=deploy/images/PULC/safety_helmet/safety_helmet_test_1.png -o Arch.use_sync_bn=False

# 输出
[{'class_ids': [0], 'scores': [0.8114636987447739], 'label_names': ['wearing_helmet'], 'file_name': 'deploy/images/PULC/safety_helmet\\safety_helmet_test_1.png'}]
[{'class_ids': [0], 'scores': [0.5641067326068878], 'label_names': ['wearing_helmet'], 'file_name': 'deploy/images/PULC/safety_helmet\\safety_helmet_test_2.png'}]

2.3 静态图预测

python deploy/python/predict_cls.py -c deploy/configs/PULC/safety_helmet/inference_safety_helmet.yaml -o Global.use_gpu=False -o Global.inference_model_dir=models\PULC_safety_helmet_infer -o Global.infer_imgs=deploy/images/PULC/safety_helmet/

# 输出
safety_helmet_test_1.png:       class id(s): [1], score(s): [1.00], label_name(s): ['unwearing_helmet']
safety_helmet_test_2.png:       class id(s): [0], score(s): [1.00], label_name(s): ['wearing_helmet']

3 人体属性识别模型

3.1 数据下载

预训练模型
推理模型

3.2 动态图预测

python tools/infer.py -c ppcls/configs/PULC/person_attribute/PPLCNet_x1_0.yaml -o Global.device=cpu -o Global.pretrained_model=models\person_attribute_pretrained -o Infer.infer_imgs=deploy/images/PULC/person_attribute/

# 输出
[{'attributes': ['Male', 'Age18-60', 'Back', 'Glasses: False', 'Hat: False', 'HoldObjectsInFront: False', 'Backpack', 'Upper: LongSleeve UpperPlaid', 'Lower:  Trousers', 'No boots'], 'output': [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1]}, 
{'attributes': ['Female', 'Age18-60', 'Side', 'Glasses: False', 'Hat: False', 'HoldObjectsInFront: False', 'No bag', 'Upper: ShortSleeve', 'Lower:  Skirt&Dress', 'No boots'], 'output': [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0]}]

4 PP-ShiTu V2图像识别系统 20221016

4.1 基本介绍

PP-ShiTuV2 是基于 PP-ShiTuV1 改进的一个实用轻量级通用图像识别系统,由主体检测、特征提取、向量检索三个模块构成,相比 PP-ShiTuV1 具有更高的识别精度、更强的泛化能力以及相近的推理速度

4.2 数据下载

主体检测inference模型: picodet_PPLCNet_x2_5_mainbody_lite_v1.0_infer

特征提取动态图模型: general_PPLCNetV2_base_pretrained_v1.0_infer
特征提取inference模型: general_PPLCNetV2_base_pretrained_v1.0_infer

测试数据drink_dataset_v2.0

4.3 全流程静态图预测

# 预测单张图片
python deploy/python/predict_system.py -c deploy/configs/inference_general.yaml -o Global.use_gpu=False -o Global.infer_imgs=deploy/drink_dataset_v2.0/test_images/001.jpeg
# 输出
[{'bbox': [0, 0, 600, 600], 'rec_docs': '红牛-强化型', 'rec_scores': 0.74081033}]

# 预测文件夹内所有图片
python deploy/python/predict_system.py -c deploy/configs/inference_general.yaml -o Global.use_gpu=False -o Global.infer_imgs=deploy/drink_dataset_v2.0/test_images
# 输出
[{'bbox': [0, 0, 600, 600], 'rec_docs': '红牛-强化型', 'rec_scores': 0.74081033}]
Inference: 78.38726043701172 ms per batch image
[{'bbox': [0, 0, 514, 436], 'rec_docs': '康师傅矿物质水', 'rec_scores': 0.6918598}]
Inference: 72.65782356262207 ms per batch image
[{'bbox': [138, 40, 573, 1198], 'rec_docs': '乐虎功能饮料', 'rec_scores': 0.6821406}]
Inference: 72.5698471069336 ms per batch image
[{'bbox': [328, 7, 467, 272], 'rec_docs': '脉动', 'rec_scores': 0.6040604}]
Inference: 79.4534683227539 ms per batch image
[{'bbox': [242, 82, 498, 726], 'rec_docs': '味全_每日C', 'rec_scores': 0.54286546}]
Inference: 73.96435737609863 ms per batch image
[{'bbox': [437, 71, 660, 728], 'rec_docs': '元气森林', 'rec_scores': 0.77402496}, {'bbox': [221, 72, 449, 701], 'rec_docs': '元气森林', 'rec_scores': 0.6950992}, {'bbox': [794, 104, 979, 652], 'rec_docs': '元气森林', 'rec_scores': 0.6305152}]
Inference: 78.69076728820801 ms per batch image
[{'bbox': [0, 0, 768, 1024], 'rec_docs': '脉动', 'rec_scores': 0.5190187}]
Inference: 79.32877540588379 ms per batch image
[{'bbox': [233, 57, 525, 1038], 'rec_docs': '康师傅冰红茶', 'rec_scores': 0.6001749}]
Inference: 76.13968849182129 ms per batch image
[{'bbox': [493, 13, 803, 829], 'rec_docs': '康师傅冰红茶', 'rec_scores': 0.70879036}, {'bbox': [189, 17, 495, 793], 'rec_docs': '康师傅冰红茶', 'rec_scores': 0.69420344}]
Inference: 71.82860374450684 ms per batch image
[]
Inference: 91.88318252563477 ms per batch image
[]
Inference: 75.86908340454102 ms per batch image
[{'bbox': [0, 0, 730, 1095], 'rec_docs': '农夫山泉-饮用天然水', 'rec_scores': 0.68553746}]
Inference: 74.47957992553711 ms per batch image

4.4 主体检测模块

# 预测单张图片
python deploy/python/predict_det.py -c deploy/configs/inference_general.yaml -o Global.use_gpu=False -o Global.infer_imgs=deploy/drink_dataset_v2.0/test_images/002.jpeg
# 输出
[{'class_id': 0, 'score': 0.8008015, 'bbox': array([2.3382977e+02, 1.4137268e-02, 3.7298141e+02, 4.3600000e+02],
      dtype=float32), 'label_name': 'foreground'}, {'class_id': 0, 'score': 0.42941576, 'bbox': array([  0.     , 272.02524, 514.     , 435.15088], dtype=float32), 'label_name': 'foreground'}, {'class_id': 0, 'score': 0.26006204, 'bbox': array([229.9466 , 266.22577, 379.64105, 435.57114], dtype=float32), 'label_name': 'foreground'}, {'class_id': 0, 'score': 0.21821804, 'bbox': array([234.0829 , 279.89706, 514.     , 435.49277], dtype=float32), 'label_name': 'foreground'}, {'class_id': 0, 'score': 0.21736334, 'bbox': array([  0.       ,   3.8394742, 472.9032   , 435.02594  ], dtype=float32), 'label_name': 'foreground'}]