在经过一系列安装操作后,nlp的分词demo可以正常运行,但是当运行ocr demo时报错
python -c "from modelscope.pipelines import pipeline;from modelscope.utils.constant import Tasks;import cv2;ocr_recognition = pipeline(Tasks.ocr_recognition, model='damo/cv_convnextTiny_ocr-recognition-general_damo');img_url = 'https://www.baidu.com/img/flexible/logo/pc/result.png';result = ocr_recognition(img_url);print(result)"
尝试了网上的解决方案:https://blog.csdn.net/weixin_45048331/article/details/112914956
没有生效感觉,还是报错。
望大家协助结局~感谢~
以下是安装遇到的坑,进行不下去的时候可尝试以下步骤:
# 指定空间
conda activate modelscope
# 清华镜像
pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 先安装依赖
conda install -c conda-forge pycocotools
# 第二次安装时魔搭前
pip install --ignore-installed llvmlite
# 安装魔搭
pip install "modelscope[cv,nlp]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
# pip install "modelscope[cv,nlp]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html --ignore-installed llvmlite
# 验证
python -c "from modelscope.pipelines import pipeline;print(pipeline('word-segmentation')('今天天气不错,适合 出去游玩'))"