# Copyright (c) Alibaba, Inc. and its affiliates.
from modelscope.outputs import OutputKeys
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
input_location = 'https://clip-multimodal.oss-cn-beijing.aliyuncs.com/xingguang/maas/data/shop_seg_demo.jpg'
model_id = 'damo/cv_vitb16_segmentation_shop-seg'
shop_seg = pipeline(Tasks.shop_segmentation, model=model_id)
result = shop_seg(input_location)
import cv2
# result[OutputKeys.MASKS] is shop segment map result,other keys are not used
cv2.imwrite('demo_shopseg.jpg', result[OutputKeys.MASKS])
模型在商品显著性分割数据集上训练,主要针对商品场景,对通用场景效果较差,请用户自行评测后决定如何使用。
训练数据共约40w商品显著性分割数据。
该模型在fss1000全量数据集上(1万张图像)zero shot iou: 79.12
@inproceedings{rao2021denseclip,
title={DenseCLIP: Language-Guided Dense Prediction with Context-Aware Prompting},
author={Rao, Yongming and Zhao, Wenliang and Chen, Guangyi and Tang, Yansong and Zhu, Zheng and Huang, Guan and Zhou, Jie and Lu, Jiwen},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
year={2022}
}