add run_in_docker scripts

This commit is contained in:
2025-08-29 14:54:34 +08:00
parent c8c53e42e6
commit 08079922ba
2 changed files with 11 additions and 4 deletions

View File

@@ -14,13 +14,13 @@ PP-OCRv4模型
- cls: https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar
### 测试
模型放在`/mnt/models/ocr/`下,运行下面的测试程序,可以识别出示例图片中的文字
模型放在`/mnt/contest_ceph/zhanghao/models/ocr/`下,运行下面的测试程序,可以识别出示例图片中的文字
```bash
python3 test.py
./run_in_docker.sh python3 test.py
```
## OCR API Server
提供了一个`http` API server可以通过服务的方式加载模型以及进行图片识别启动命令如下
```bash
python3 app.py
```
./run_in_docker.sh python3 app.py
```

7
run_in_docker.sh Executable file
View File

@@ -0,0 +1,7 @@
gpu=0
command="python3 test.py"
if [[ $# -ge 1 ]]; then
command=$@
fi
docker run -p 8080:80 -v `pwd`:/workspace -v /mnt/contest_ceph/zhanghao/models/ocr:/mnt/models/ocr -v /dev:/dev --device=/dev/iluvatar$gpu:/dev/iluvatar0 paddleocr:bi $command