1 Star 0 Fork 132

Gavin / cnocr

forked from cyahua / cnocr 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Makefile.gpu 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
breezedeus 提交于 2020-04-19 23:24 . adapt to new design
DATA_ROOT_DIR = /data2/ocr/outer
REC_DATA_ROOT_DIR = /dev/data/jinlong/data
# ['conv', 'conv-lite', 'densenet', 'densenet-lite']
EMB_MODEL_TYPE = densenet-lite
SEQ_MODEL_TYPE = lstm
MODEL_NAME = $(EMB_MODEL_TYPE)-$(SEQ_MODEL_TYPE)
EPOCH = 20
gen-lst:
python scripts/im2rec.py --list --num-label 20 --chunks 1 --train-idx-fp $(DATA_ROOT_DIR)/train.txt \
--test-idx-fp $(DATA_ROOT_DIR)/test.txt --prefix $(DATA_ROOT_DIR)/lst/cnocr
gen-rec:
python scripts/im2rec.py --pack-label --color 1 --num-thread 1 --prefix $(DATA_ROOT_DIR)/lst --root $(DATA_ROOT_DIR)
##
## copy rec dir from $(DATA_ROOT_DIR) to $(REC_DATA_ROOT_DIR)
##
train:
nohup python scripts/cnocr_train.py --gpu 2 --emb_model_type $(EMB_MODEL_TYPE) --seq_model_type $(SEQ_MODEL_TYPE) \
--optimizer Adam --epoch $(EPOCH) --lr 3e-4 \
--train_file $(REC_DATA_ROOT_DIR)/lst/cnocr_train --test_file $(REC_DATA_ROOT_DIR)/lst/cnocr_test \
>> nohup-$(MODEL_NAME).out 2>&1 &
predict:
python scripts/cnocr_predict.py --model_name $(MODEL_NAME) --file examples/rand_cn1.png
.PHONY: gen-lst gen-rec train predict
Python
1
https://gitee.com/gavin-chan/cnocr.git
git@gitee.com:gavin-chan/cnocr.git
gavin-chan
cnocr
cnocr
master

搜索帮助