1 Star 0 Fork 138

黄老邪/cnocr

forked from cyahua/cnocr 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 1.52 KB
一键复制 编辑 原始数据 按行查看 历史
breezedeus 提交于 2023-12-22 19:20 . always be smarter
# 可取值:['densenet_lite_136']
ENCODER_NAME = densenet_lite_136
# 可取值:['fc', 'gru', 'lstm']
DECODER_NAME = fc
MODEL_NAME = $(ENCODER_NAME)-$(DECODER_NAME)
EPOCH = 41
INDEX_DIR = data/test
TRAIN_CONFIG_FP = docs/examples/train_config.json
# 训练模型
train:
cnocr train -m $(MODEL_NAME) --index-dir $(INDEX_DIR) --train-config-fp $(TRAIN_CONFIG_FP)
# 训练模型
train-number-pure:
cnocr train -m number-$(MODEL_NAME) --index-dir data/number-pure-index --train-config-fp docs/examples/train_config_number.json
# 在测试集上评估模型,所有badcases的具体信息会存放到文件夹 `evaluate/$(MODEL_NAME)` 中
evaluate:
cnocr evaluate --model-name $(MODEL_NAME) -i data/test/dev.tsv \
--image-folder data/images --batch-size 128 -o eval_results/$(MODEL_NAME)
predict:
cnocr predict -m $(MODEL_NAME) -i docs/examples/rand_cn1.png
# build and serve mkdocs
doc:
# pip install mkdocs
# pip install mkdocs-macros-plugin
# pip install mkdocs-material
# pip install mkdocstrings
python -m mkdocs serve
# python -m mkdocs build
package:
rm -rf build
python setup.py sdist bdist_wheel
VERSION := $(shell sed -n "s/^__version__ = '\(.*\)'/\1/p" cnocr/__version__.py)
upload:
python -m twine upload dist/cnocr-$(VERSION)* --verbose
# 开启 OCR HTTP 服务
serve:
cnocr serve -H 0.0.0.0 -p 8501 --reload
# 开启监控截屏文件夹的守护进程
daemon:
python scripts/screenshot_daemon.py
docker-build:
docker build -t breezedeus/cnocr:v$(VERSION) .
.PHONY: train evaluate predict doc package upload serve daemon
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/hlx518/cnocr.git
git@gitee.com:hlx518/cnocr.git
hlx518
cnocr
cnocr
master

搜索帮助