[to #42794773]rename pydataset to msdataset

Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9165402
This commit is contained in:
yingda.chen
2022-06-27 11:09:38 +08:00
parent b6e3fd80b0
commit 6702b29e21
16 changed files with 47 additions and 48 deletions

View File

@@ -1,7 +1,7 @@
modelscope.pydatasets package
modelscope.msdatasets package
=============================
.. automodule:: modelscope.pydatasets
.. automodule:: modelscope.msdatasets
:members:
:undoc-members:
:show-inheritance:
@@ -9,10 +9,10 @@ modelscope.pydatasets package
Submodules
----------
modelscope.pydatasets.py\_dataset module
modelscope.msdatasets.ms\_dataset module
----------------------------------------
.. automodule:: modelscope.pydatasets.py_dataset
.. automodule:: modelscope.msdatasets.ms_dataset
:members:
:undoc-members:
:show-inheritance:

View File

@@ -16,7 +16,7 @@ Subpackages
modelscope.models
modelscope.pipelines
modelscope.preprocessors
modelscope.pydatasets
modelscope.msdatasets
modelscope.trainers
modelscope.utils

View File

@@ -3,7 +3,7 @@
## python环境配置
首先,参考[文档](https://docs.anaconda.com/anaconda/install/) 安装配置Anaconda环境
安装完成后执行如下命令为maas library创建对应的python环境。
安装完成后执行如下命令为modelscope library创建对应的python环境。
```shell
conda create -n modelscope python=3.6
conda activate modelscope
@@ -105,15 +105,15 @@ import cv2
import os.path as osp
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
from modelscope.pydatasets import PyDataset
from modelscope.msdatasets import MsDataset
# 使用图像url构建PyDataset此处也可通过 input_location = '/dir/to/images' 来使用本地文件夹
# 使用图像url构建MsDataset此处也可通过 input_location = '/dir/to/images' 来使用本地文件夹
input_location = [
'http://pai-vision-data-hz.oss-cn-zhangjiakou.aliyuncs.com/data/test/maas/image_matting/test.png'
]
dataset = PyDataset.load(input_location, target='image')
dataset = MsDataset.load(input_location, target='image')
img_matting = pipeline(Tasks.image_matting, model='damo/image-matting-person')
# 输入为PyDataset时输出的结果为迭代器
# 输入为MsDataset时输出的结果为迭代器
result = img_matting(dataset)
cv2.imwrite('result.png', next(result)['output_png'])
print(f'Output written to {osp.abspath("result.png")}')