输入一张图像,先进行人检测,再对检测到的人体区域进行属性检识别,输出所有人体区域检测框和属性值。
该模型主要用于行人属性识别任务,从图像中检测出人体框坐标和属性。该任务使用ReseNet50模型在PA100K和RAP综合数据集上训练而来,实验细节请参考论文Improving Pedestrian Attribute Recognition With Weakly-Supervised Multi-Scale Attribute-Specific Localization", ICCV 2019, Seoul, [https://arxiv.org/abs/1910.04562]。
使用方式:
目标场景:
在ModelScope框架上,提供输入图片,即可以通过简单的Pipeline调用来完成行人属性识别任务。
也可以参考示例代码tests/pipelines/test_pedestrian_attribute_recognition.py
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
model_id = 'damo/cv_resnet50_pedestrian-attribute-recognition_image'
pedestrian_attribute_recognition = pipeline(Tasks.pedestrian_attribute_recognition, model=model_id)
output = pedestrian_attribute_recognition('https://modelscope.oss-cn-beijing.aliyuncs.com/test/images/keypoints_detect/000000442836.jpg')
# the output contains boxes and labels
print(output)
训练数据来自公开数据集PA100K[https://www.v7labs.com/open-datasets/pa-100k]和RAP[https://www.rapdataset.com]。
模型在公开测试数据集上的评价指标如下:
输入大小 | mAP | Accuracy | Precision | Recall | F1_Score | mean-result |
---|---|---|---|---|---|---|
384x192x3 | 0.831774 | 0.883914 | 0.933503 | 0.932833 | 0.933168 | 0.903038 |
Attr | p_true/n_true | p_tol/n_tol | p_pred/n_pred | cur_mA |
---|---|---|---|---|
0: Female | 1455\3351 | 1547\3419 | 1523\3443 | 0.96032 |
1: AgeOver60 | 0\4984 | 0\4984 | 0\4984 | 0.50000 |
2: Age18-60 | 4924\ 28 | 4930\ 54 | 4950\ 34 | 0.75865 |
3: AgeLess18 | 26\4925 | 54\4930 | 31\4953 | 0.74023 |
4: Front | 1303\3481 | 1395\3589 | 1411\3573 | 0.95198 |
5: Side | 1704\2928 | 1893\3091 | 1867\3117 | 0.92371 |
6: Back | 1615\3198 | 1696\3288 | 1705\3279 | 0.96243 |
7: Hat | 49\4893 | 85\4899 | 55\4929 | 0.78762 |
8: Glasses | 277\4557 | 359\4625 | 345\4639 | 0.87844 |
9: HandBag | 200\4570 | 317\4667 | 297\4687 | 0.80507 |
10: ShoulderBag | 213\4603 | 312\4672 | 282\4702 | 0.83396 |
11: Backpack | 71\4861 | 105\4879 | 89\4895 | 0.83625 |
12: ShortSleeve | 61\4876 | 94\4890 | 75\4909 | 0.82304 |
13: LongSleeve | 4876\ 61 | 4890\ 94 | 4909\ 75 | 0.82304 |
14: Trousers | 4745\ 170 | 4781\ 203 | 4778\ 206 | 0.91495 |
15: Shorts | 0\4977 | 7\4977 | 0\4984 | 0.50000 |
16: Skirt&Dress | 277\4532 | 362\4622 | 367\4617 | 0.87286 |
17: 上黑 | 1973\2654 | 2134\2850 | 2169\2815 | 0.92789 |
18: 上灰 | 370\4400 | 457\4527 | 497\4487 | 0.89079 |
19: 上蓝 | 438\4428 | 502\4482 | 492\4492 | 0.93023 |
20: 上绿 | 468\4200 | 619\4365 | 633\4351 | 0.85913 |
21: 上白 | 327\4518 | 380\4604 | 413\4571 | 0.92092 |
22: 上紫 | 73\4878 | 86\4898 | 93\4891 | 0.92238 |
23: 上红 | 401\4505 | 431\4553 | 449\4535 | 0.95993 |
24: 上棕 | 55\4871 | 86\4898 | 82\4902 | 0.81701 |
25: 上黄 | 78\4863 | 95\4889 | 104\4880 | 0.90787 |
26: 上粉 | 102\4821 | 132\4852 | 133\4851 | 0.88317 |
27: 上橙 | 45\4905 | 62\4922 | 62\4922 | 0.86118 |
28: 下黑 | 2830\1705 | 3093\1891 | 3016\1968 | 0.90830 |
29: 下灰 | 165\4688 | 237\4747 | 224\4760 | 0.84189 |
30: 下蓝 | 939\3807 | 1032\3952 | 1084\3900 | 0.93660 |
31: 下绿 | 184\4586 | 264\4720 | 318\4666 | 0.83429 |
32: 下白 | 14\4944 | 28\4956 | 26\4958 | 0.74879 |
33: 下紫 | 0\4984 | 0\4984 | 0\4984 | 0.50000 |
34: 下红 | 33\4936 | 35\4949 | 46\4938 | 0.97012 |
35: 下棕 | 5\4966 | 13\4971 | 10\4974 | 0.69180 |
36: 下黄 | 39\4929 | 42\4942 | 52\4932 | 0.96297 |
37: 下粉 | 1\4980 | 3\4981 | 2\4982 | 0.66657 |
38: 下橙 | 1\4978 | 4\4980 | 3\4981 | 0.62480 |
@article{DBLP:journals/corr/abs-1910-04562,
author = {Chufeng Tang and
Lu Sheng and
Zhaoxiang Zhang and
Xiaolin Hu},
title = {Improving Pedestrian Attribute Recognition With Weakly-Supervised
Multi-Scale Attribute-Specific Localization},
journal = {CoRR},
volume = {abs/1910.04562},
year = {2019},
url = {http://arxiv.org/abs/1910.04562},
eprinttype = {arXiv},
eprint = {1910.04562},
timestamp = {Tue, 02 Aug 2022 14:18:00 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-1910-04562.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
git clone https://www.modelscope.cn/damo/cv_resnet50_pedestrian-attribute-recognition_image.git