1 Star 0 Fork 1

FFFFFFFF/chinese-ocr-win

forked from amoxuk/chinese-ocr-win 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
setup-win-cpu.txt 1.66 KB
一键复制 编辑 原始数据 按行查看 历史
lihow 提交于 2019-04-07 23:14 . 2019-4-7
conda create -n chinese-ocr python=3.5 pip scipy numpy PIL jupyter##运用conda 创建python环境
activate chinese-ocr
pip install easydict -i https://pypi.tuna.tsinghua.edu.cn/simple/ ##选择国内源,速度更快
pip install keras==2.0.8 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install Cython opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install -U pillow -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install h5py lmdb mahotas -i https://pypi.tuna.tsinghua.edu.cn/simple/
conda install pytorch-cpu -c pytorch #解决window安装pytorch无源问题
pip install torchvision
conda install tensorflow=1.3 ##解决cuda报错相关问题
#配置ctpn按照https://github.com/eragonruan/text-detection-ctpn/issues/73配置
即:
step 1:make some change
change "np.int_t " to "np.intp_t" in line 25 of the file lib\utils\cython_nms.pyx
otherwise appear " ValueError: Buffer dtype mismatch, expected 'int_t' but got 'long long' " in step 6.
step 2:updata c file
execute:cd your_dir\text-detection-ctpn-master\lib\utils
execute:cython bbox.pyx
execute:cython cython_nms.pyx
step 3:builf setup file as setup_new.py
import numpy as np
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
numpy_include = np.get_include()
setup(ext_modules=cythonize("bbox.pyx"),include_dirs=[numpy_include])
setup(ext_modules=cythonize("cython_nms.pyx"),include_dirs=[numpy_include])
step 4:build .pyd file
execute:python setup_new.py install
copy bbox.cp36-win_amd64.pyd and cython_nms.cp36-win_amd64.pyd to your_dir\text-detection-ctpn-master\lib\utils
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/ztty8888/chinese-ocr-win.git
git@gitee.com:ztty8888/chinese-ocr-win.git
ztty8888
chinese-ocr-win
chinese-ocr-win
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385