70 Star 395 Fork 132

cyahua / cnocr

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
gpu.Makefile 1.21 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史
breezedeus 提交于 2023-09-21 12:00 . fix typo
# 可取值:['densenet-s']
ENCODER_NAME = densenet_lite_136
# 可取值:['fc', 'gru', 'lstm']
DECODER_NAME = fc
MODEL_NAME = $(ENCODER_NAME)-$(DECODER_NAME)
INDEX_DIR = data/output_normal
TRAIN_CONFIG_FP = docs/examples/train_config_gpu.json
train:
cnocr train -m $(MODEL_NAME) --index-dir $(INDEX_DIR) --train-config-fp $(TRAIN_CONFIG_FP)
# 训练模型
train-number-pure:
CUDA_VISIBLE_DEVICES=1 cnocr train -m number-$(MODEL_NAME) --index-dir data/output_number_pure --train-config-fp docs/examples/train_config_number.json
evaluate-number-pure:
cnocr evaluate -m number-$(MODEL_NAME) -i data/output_number_pure/dev.tsv --image-folder data/output_number_pure --batch-size 128 -c cuda:0 -o eval_results/number-$(MODEL_NAME)
evaluate:
cnocr evaluate -m $(MODEL_NAME) -i $(REC_DATA_ROOT_DIR)/test-part.txt --image-folder $(REC_DATA_ROOT_DIR) --batch-size 128 -c cuda:0 -o eval_results/$(MODEL_NAME)-$(EPOCH)
filter:
python scripts/filter_samples.py --sample_file $(REC_DATA_ROOT_DIR)/test-part.txt --badcases_file evaluate/$(MODEL_NAME)-$(EPOCH)/badcases.txt --distance_thrsh 2 -o $(REC_DATA_ROOT_DIR)/new.txt
predict:
cnocr predict -m $(MODEL_NAME) -f docs/examples/rand_cn1.png
.PHONY: train predict evaluate filter
Python
1
https://gitee.com/cyahua/cnocr.git
git@gitee.com:cyahua/cnocr.git
cyahua
cnocr
cnocr
master

搜索帮助

14c37bed 8189591 565d56ea 8189591