- python3.x with
- opencv-python
- pytorch
- torchvision
setuptool
Create file setup.py in nms directory and type the following script.
from setuptools import setup, Extension
functions_module = Extension(
name='adaptor',
sources=['adaptor.cpp', 'include/clipper/clipper.cpp'],
#sources=['adaptor.cpp'],
include_dirs=[r'.\include',
r'E:\install\Anaconda3\include'] # change to your path
)
setup(ext_modules=[functions_module])
Compile
First make sure c++ compiling toolchain is in PATH.
On windows its better to use VisualStudio's Prompt cmd env.
python setup.py build_ext --inplace
Warp-ctc To make life easier, I just install the module with pip.
pip install torch-baidu-ctc
wget http://ptak.felk.cvut.cz/public_datasets/SyntText/e2e-mlt.h5
下载的模型为 7500 字符集的,而代码中设置的为8400,需要改一下不然跑不起来。将
models.py里面的 8400 替换为 7500, 我已经改好了,直接用。
python3 demo.py -model=e2e-mlt.h5
跑起来比较慢,笔记本电脑跑起来非常的卡。
python3 demo.py -cuda=0 -model=e2e-mlt.h5