1、拉取PaddleSeg源码
git clone https://github.com.cnpmjs.org/PaddlePaddle/PaddleSeg.git
2、跑通Python API预测模型
(1)准备环境
pip3 install filelock
pip3 install --ignore-installed PyYAML
将paddleSeg的部分依赖库放入预测文件夹中,以供调用:
cd PaddleSeg/deploy && cp -r ../paddleseg/ ./python/
(2)下载示例模型
wget https://paddleseg.bj.bcebos.com/dygraph/demo/bisenet_demo_model.tar.gz && tar xzf bisenet_demo_model.tar.gz
(3)下载示例图片
wget https://paddleseg.bj.bcebos.com/dygraph/demo/cityscapes_demo.png
(3)推理
python3 infer.py --config ../bisenetv2_demo_model/deploy.yaml --image_path ../cityscapes_demo.png
(4)推理结果
推理效果如下所示:
|