add run_in_docker scripts
This commit is contained in:
@@ -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
7
run_in_docker.sh
Executable 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
|
||||
Reference in New Issue
Block a user