Upload 13 files
Browse files- .gitattributes +3 -0
- AfsHumanParsing/ahp_ckpts/RealESRGAN_x4plus.pth +3 -0
- AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/.mdl +0 -0
- AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/.msc +0 -0
- AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/.mv +1 -0
- AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/README.md +131 -0
- AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/configuration.json +97 -0
- AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/description/demo.jpg +0 -0
- AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/description/demo2.jpg +0 -0
- AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/description/demo_result.jpg +3 -0
- AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/description/m2fp_arch.png +3 -0
- AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/pytorch_model.pt +3 -0
- AfsHumanParsing/ahp_ckpts/sapiens_1b_goliath_best_goliath_mIoU_7994_epoch_151_torchscript.pt2 +3 -0
- AfsHumanParsing/ahp_ckpts/yolov8x.pt +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/description/demo_result.jpg filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/description/m2fp_arch.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
AfsHumanParsing/ahp_ckpts/sapiens_1b_goliath_best_goliath_mIoU_7994_epoch_151_torchscript.pt2 filter=lfs diff=lfs merge=lfs -text
|
AfsHumanParsing/ahp_ckpts/RealESRGAN_x4plus.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4fa0d38905f75ac06eb49a7951b426670021be3018265fd191d2125df9d682f1
|
| 3 |
+
size 67040989
|
AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/.mdl
ADDED
|
Binary file (69 Bytes). View file
|
|
|
AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/.msc
ADDED
|
Binary file (544 Bytes). View file
|
|
|
AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/.mv
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Revision:v1.0.1,CreatedAt:1676291246
|
AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tasks:
|
| 3 |
+
- image-segmentation
|
| 4 |
+
widgets:
|
| 5 |
+
- task: image-segmentation
|
| 6 |
+
inputs:
|
| 7 |
+
- type: image
|
| 8 |
+
examples:
|
| 9 |
+
- name: 1
|
| 10 |
+
title: 示例1
|
| 11 |
+
inputs:
|
| 12 |
+
- data: git://description/demo.jpg
|
| 13 |
+
- name: 2
|
| 14 |
+
title: 示例2
|
| 15 |
+
inputs:
|
| 16 |
+
- data: git://description/demo2.jpg
|
| 17 |
+
inferencespec:
|
| 18 |
+
cpu: 4
|
| 19 |
+
memory: 8000
|
| 20 |
+
gpu: 1
|
| 21 |
+
gpu_memory: 16000
|
| 22 |
+
model-type:
|
| 23 |
+
- m2fp
|
| 24 |
+
domain:
|
| 25 |
+
- cv
|
| 26 |
+
frameworks:
|
| 27 |
+
- pytorch
|
| 28 |
+
backbone:
|
| 29 |
+
- ResNet-101
|
| 30 |
+
metrics:
|
| 31 |
+
- mIoU
|
| 32 |
+
- APr
|
| 33 |
+
customized-quickstart: True
|
| 34 |
+
finetune-support: False
|
| 35 |
+
license: Other
|
| 36 |
+
tags:
|
| 37 |
+
- Alibaba
|
| 38 |
+
- multiple human parsing
|
| 39 |
+
- M2FP
|
| 40 |
+
datasets:
|
| 41 |
+
train:
|
| 42 |
+
- modelscope/CIHP
|
| 43 |
+
evaluation:
|
| 44 |
+
- modelscope/CIHP
|
| 45 |
+
---
|
| 46 |
+
|
| 47 |
+
# M2FP多人人体解析模型介绍
|
| 48 |
+
|
| 49 |
+
## 模型描述
|
| 50 |
+
|
| 51 |
+
M2FP(Mask2Former for Parsing,[官方代码](https://github.com/soeaver/M2FP))基于 Mask2Former 架构,并进行了一些改进以适应人体解析。 M2FP 可以适应几乎所有人体解析任务并产生惊人的性能。
|
| 52 |
+
|
| 53 |
+
模型整体架构图如下:
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
|
| 57 |
+
## 期望模型使用方式以及适用范围
|
| 58 |
+
|
| 59 |
+
本模型适用于包含多个人体的图像,对图片中的人体各组件进行解析、分割。
|
| 60 |
+
|
| 61 |
+
### 如何使用
|
| 62 |
+
|
| 63 |
+
在ModelScope框架上,提供输入图片,即可通过简单的Pipeline调用来使用。
|
| 64 |
+
|
| 65 |
+
#### 代码范例
|
| 66 |
+
```python
|
| 67 |
+
from modelscope.outputs import OutputKeys
|
| 68 |
+
from modelscope.pipelines import pipeline
|
| 69 |
+
from modelscope.utils.constant import Tasks
|
| 70 |
+
|
| 71 |
+
input_img = 'https://modelscope.oss-cn-beijing.aliyuncs.com/test/images/mog_face_detection.jpg'
|
| 72 |
+
segmentation_pipeline = pipeline(Tasks.image_segmentation, 'damo/cv_resnet101_image-multiple-human-parsing')
|
| 73 |
+
result = segmentation_pipeline(input_img)
|
| 74 |
+
print(result[OutputKeys.LABELS])
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
### 模型局限性以及可能的偏差
|
| 78 |
+
|
| 79 |
+
- 部分非常规图片或人体占比太小或遮挡严重可能会影响分割结果
|
| 80 |
+
- 本模型依赖mmcv-full,需用户在机器上正确安装[mmcv-full](https://mmcv.readthedocs.io/en/latest/get_started/installation.html)
|
| 81 |
+
- 部分代码依赖CC BY-NC 4.0 license,不支持商用
|
| 82 |
+
|
| 83 |
+
## 训练数据介绍
|
| 84 |
+
|
| 85 |
+
- CIHP,大规模多人人体解析数据集,[官方地址](https://lip.sysuhcp.com/overview.php)。
|
| 86 |
+
|
| 87 |
+
## 模型训练流程
|
| 88 |
+
|
| 89 |
+
- 请参考原论文
|
| 90 |
+
|
| 91 |
+
## 数据评估及结果
|
| 92 |
+
|
| 93 |
+
模型在CIHP验证集上进行评估,结果如下:
|
| 94 |
+
|
| 95 |
+
| Backbone | Pretrain | Epochs | mIoU | APr | #params | FLOPs |
|
| 96 |
+
|:----------:|:-----------:|:------:|:-----:|:-----:|:-------:|:------:|
|
| 97 |
+
| ResNet-101 | ImageNet-1k | 150 | 69.15 | 60.47 | 63.0M | 206.2G |
|
| 98 |
+
|
| 99 |
+
注:测试时使用了 TTA(Test Time Augmentation)数据增强
|
| 100 |
+
|
| 101 |
+
可视化结果:
|
| 102 |
+
|
| 103 |
+
 
|
| 104 |
+
|
| 105 |
+
## 引用
|
| 106 |
+
如果你觉得该模型对你有所帮助,请考虑引用下面的相关论文:
|
| 107 |
+
|
| 108 |
+
```BibTeX
|
| 109 |
+
@article{yang2023humanparsing,
|
| 110 |
+
title={Deep Learning Technique for Human Parsing: A Survey and Outlook},
|
| 111 |
+
author={Lu Yang and Wenhe Jia and Shan Li and Qing Song},
|
| 112 |
+
journal={arXiv preprint arXiv:2301.00394},
|
| 113 |
+
year={2023}
|
| 114 |
+
}
|
| 115 |
+
```
|
| 116 |
+
```BibTeX
|
| 117 |
+
@inproceedings{cheng2021mask2former,
|
| 118 |
+
title={Masked-attention Mask Transformer for Universal Image Segmentation},
|
| 119 |
+
author={Bowen Cheng and Ishan Misra and Alexander G. Schwing and Alexander Kirillov and Rohit Girdhar},
|
| 120 |
+
journal={CVPR},
|
| 121 |
+
year={2021}
|
| 122 |
+
}
|
| 123 |
+
```
|
| 124 |
+
```BibTeX
|
| 125 |
+
@inproceedings{cheng2021maskformer,
|
| 126 |
+
title={Per-Pixel Classification is Not All You Need for Semantic Segmentation},
|
| 127 |
+
author={Bowen Cheng and Alexander G. Schwing and Alexander Kirillov},
|
| 128 |
+
journal={NeurIPS},
|
| 129 |
+
year={2021}
|
| 130 |
+
}
|
| 131 |
+
```
|
AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/configuration.json
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"framework": "pytorch",
|
| 3 |
+
|
| 4 |
+
"task": "image-segmentation",
|
| 5 |
+
|
| 6 |
+
"pipeline": {
|
| 7 |
+
"type": "m2fp-image-human-parsing"
|
| 8 |
+
},
|
| 9 |
+
|
| 10 |
+
"model": {
|
| 11 |
+
"type": "m2fp",
|
| 12 |
+
"pretrained": true,
|
| 13 |
+
"parsing_ins_score_thr": 0.3,
|
| 14 |
+
"parsing_on": true,
|
| 15 |
+
"semantic_on": false,
|
| 16 |
+
"sem_seg_postprocess_before_inference": false,
|
| 17 |
+
"single_human": false,
|
| 18 |
+
"with_human_instance": true,
|
| 19 |
+
"num_parsing": 20,
|
| 20 |
+
"backbone": {
|
| 21 |
+
"depth": 101,
|
| 22 |
+
"norm": "BN",
|
| 23 |
+
"num_groups": 1,
|
| 24 |
+
"out_features": [
|
| 25 |
+
"res2",
|
| 26 |
+
"res3",
|
| 27 |
+
"res4",
|
| 28 |
+
"res5"
|
| 29 |
+
],
|
| 30 |
+
"res2_out_channels": 256,
|
| 31 |
+
"res4_dilation": 1,
|
| 32 |
+
"res5_dilation": 1,
|
| 33 |
+
"res5_multi_grid": [
|
| 34 |
+
1,
|
| 35 |
+
1,
|
| 36 |
+
1
|
| 37 |
+
],
|
| 38 |
+
"stem_out_channels": 128,
|
| 39 |
+
"stride_in_1x1": false,
|
| 40 |
+
"width_per_group": 64
|
| 41 |
+
},
|
| 42 |
+
"encoder": {
|
| 43 |
+
"common_stride": 4,
|
| 44 |
+
"conv_dim": 256,
|
| 45 |
+
"in_features": [
|
| 46 |
+
"res2",
|
| 47 |
+
"res3",
|
| 48 |
+
"res4",
|
| 49 |
+
"res5"
|
| 50 |
+
],
|
| 51 |
+
"transformer_in_features": [
|
| 52 |
+
"res3",
|
| 53 |
+
"res4",
|
| 54 |
+
"res5"
|
| 55 |
+
],
|
| 56 |
+
"transformer_dim_feedforward": 1024,
|
| 57 |
+
"mask_dim": 256,
|
| 58 |
+
"transformer_enc_layers": 6,
|
| 59 |
+
"transformer_nheads": 8,
|
| 60 |
+
"transformer_dropout": 0
|
| 61 |
+
},
|
| 62 |
+
"decoder": {
|
| 63 |
+
"num_classes": 21,
|
| 64 |
+
"hidden_dim": 256,
|
| 65 |
+
"num_queries": 100,
|
| 66 |
+
"nheads": 8,
|
| 67 |
+
"dim_feedforward": 2048,
|
| 68 |
+
"dec_layers": 9,
|
| 69 |
+
"pre_norm": false,
|
| 70 |
+
"enforce_input_project": false,
|
| 71 |
+
"mask_dim": 256
|
| 72 |
+
},
|
| 73 |
+
"classes": [
|
| 74 |
+
"Background",
|
| 75 |
+
"Hat",
|
| 76 |
+
"Hair",
|
| 77 |
+
"Gloves",
|
| 78 |
+
"Sunglasses",
|
| 79 |
+
"UpperClothes",
|
| 80 |
+
"Dress",
|
| 81 |
+
"Coat",
|
| 82 |
+
"Socks",
|
| 83 |
+
"Pants",
|
| 84 |
+
"Torso-skin",
|
| 85 |
+
"Scarf",
|
| 86 |
+
"Skirt",
|
| 87 |
+
"Face",
|
| 88 |
+
"Left-arm",
|
| 89 |
+
"Right-arm",
|
| 90 |
+
"Left-leg",
|
| 91 |
+
"Right-leg",
|
| 92 |
+
"Left-shoe",
|
| 93 |
+
"Right-shoe",
|
| 94 |
+
"Human"
|
| 95 |
+
]
|
| 96 |
+
}
|
| 97 |
+
}
|
AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/description/demo.jpg
ADDED
|
AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/description/demo2.jpg
ADDED
|
AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/description/demo_result.jpg
ADDED
|
Git LFS Details
|
AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/description/m2fp_arch.png
ADDED
|
Git LFS Details
|
AfsHumanParsing/ahp_ckpts/cv_resnet101_image-multiple-human-parsing/pytorch_model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7451e822298c8dee3781444ebd490bc43f192ca135b66ada841f16245746bad1
|
| 3 |
+
size 757764792
|
AfsHumanParsing/ahp_ckpts/sapiens_1b_goliath_best_goliath_mIoU_7994_epoch_151_torchscript.pt2
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:33bba30f3de8d9cfd44e4eaa4817b1bfdd98c188edfc87fa7cc031ba0f4edc17
|
| 3 |
+
size 4716314057
|
AfsHumanParsing/ahp_ckpts/yolov8x.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c4d5a3f000d771762f03fc8b57ebd0aae324aeaefdd6e68492a9c4470f2d1e8b
|
| 3 |
+
size 136867539
|