OCR:PixelLink实验

安装ubuntu16.04

下载代码包

github(pixelLink)

git clone --recursive git@github.com:ZJULearning/pixel_link.git

错误:
在这里插入图片描述
解决:github添加ssh公钥

环境配置

1、安装Anaconda
在这里插入图片描述
2、

conda env create --file pixel_link_env.txt
source activate pixel_link

报错:
在这里插入图片描述
我找了好久解决办法呜呜呜
最后在github上找到了
答案竟在我眼前

解决办法:将文件后缀 .txt 改为 .yml
conda env create --file pixel_link_env.txt 报错
在这里插入图片描述

下载预训练模型

PixelLink + VGG16 2s , trained on IC15 百度网盘
解压模型:
在这里插入图片描述
将它们的父目录表示为 ${model_path}

数据集测试

在这里插入图片描述

ICDAR2015
将下载好的数据集放入 datasets/ICDAR2015

./scripts/test.sh 3 ~/model_path/conv2_2/model.ckpt-73018 ~/datasets/ICDAR2015/ch4_test_images

报错:ImportError: libcuda.so.1: cannot open shared object file: No such file or directory
解决:修改驱动

./scripts/test.sh 3 ~/model_path/conv2_2/model.ckpt-73018 ~/datasets/ICDAR2015/ch4_test_images

报错:ImportError: No module named util
在这里插入图片描述
解决:未配置环境变量(可能是中途重启过 需要在终端重新配置)

export PYTHONPATH=$PYTHONPATH:/你的路径/pixel_link/pylib/src
./scripts/test.sh 3 ~/model_path/conv2_2/model.ckpt-73018 ~/datasets/ICDAR2015/ch4_test_images

报错:ImportError: No module named matplotlib
在这里插入图片描述

pip install matplotlib

在这里插入图片描述

pip --default-timeout=100  install matplotlib
./scripts/test.sh 3 ~/model_path/conv2_2/model.ckpt-73018 ~/datasets/ICDAR2015/ch4_test_images

报错:ImportError: No module named enum
解决:pip install enum

./scripts/test.sh 3 ~/model_path/conv2_2/model.ckpt-73018 ~/datasets/ICDAR2015/ch4_test_images

报错:ImportError: cannot import name IntEnum
解决:pip install enum34

./scripts/test.sh 3 ~/model_path/conv2_2/model.ckpt-73018 ~/datasets/ICDAR2015/ch4_test_images

报错:ImportError: No module named pyximport

pip install pyximport

报错:
Could not find a version that satisfies the requirement pyximport (from versions: )
No matching distribution found for pyximport
解决:pip install cython

./scripts/test.sh 3 ~/model_path/conv2_2/model.ckpt-73018 ~/datasets/ICDAR2015/ch4_test_images

报错:UnboundLocalError: local variable ‘setproctitle’ referenced before assignment
解决:
1、Run ‘pip install setproctitle’
2、Then add “import setproctitle” to the top of …/pixel_link/pylib/src/util/proc.py

# 报错no such directory,因此这里文件的路径有所修改
./scripts/test.sh 3 ~/anaconda3/envs/pixel_link/model_path/conv2_2/model.ckpt-73018 ~/anaconda3/envs/pixel_link/datasets/ICDAR2015/ch4_test_images

跑了差不多一个半小时
在这里插入图片描述
在这里插入图片描述

可视化

vis

# 前面是测试集的路径,后面是生成结果txt文本的路径
# 结果生成在 /temp/no_use/pixel_result (终端会显示这个文件夹的父目录)
scripts/vis.sh ~/anaconda3/envs/pixel_link/datasets/ICDAR2015/ch4_test_images ~/anaconda3/envs/pixel_link/model_path/conv2_2/test/icdar2015_test/model.ckpt-73018/txt

在这里插入图片描述
在这里插入图片描述

测试任意图像

# 前面是模型的路径,后面代测图像所在文件夹
# 结果会自动生成在 /temp/no_use/images
./scripts/test_any.sh 3 ~/anaconda3/envs/pixel_link/model_path/conv2_2/model.ckpt-73018 ~/anaconda3/envs/pixel_link/image_dir

对中文检测结果不佳
在这里插入图片描述

每一次打开终端测试图片时都要重新设置

conda env create --file pixel_link_env.txt
source activate pixel_link
export PYTHONPATH=$PYTHONPATH:/home/fwt/anaconda3/envs/pixel_link/pylib/src
./scripts/test_any.sh 3 ~/anaconda3/envs/pixel_link/model_path/conv2_2/model.ckpt-73018 ~/anaconda3/envs/pixel_link/image_dir
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值