u
No files matched your search
|
Before Width: | Height: | Size: 465 KiB After Width: | Height: | Size: 643 KiB |
|
After Width: | Height: | Size: 183 KiB |
|
After Width: | Height: | Size: 146 KiB |
@@ -50,7 +50,7 @@ public class Test {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
String API_URL = "http://localhost:8866/ocr";
|
||||
String imagePath = "D:\\workspace\\code\\crane\\crane-api\\crane-test\\src\\main\\java\\com\\crane\\test\\namorni-preprava-namorni-doprava-kamionova-doprava-kontejneru-2-1024x768.jpg";
|
||||
String imagePath = "D:\\workspace\\code\\crane\\crane-api\\crane-test\\src\\main\\java\\com\\crane\\test\\bd88d3c9-2cb9-462a-b5b2-afb2fa0cda8c.jpg";
|
||||
String compressedImagePath = "D:\\workspace\\code\\crane\\crane-api\\crane-test\\compressed.jpg";
|
||||
|
||||
long base64StartTime = System.nanoTime();
|
||||
|
||||
|
After Width: | Height: | Size: 225 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 77 KiB |
@@ -0,0 +1,32 @@
|
||||
# Windows安装
|
||||
|
||||
## 安装
|
||||
|
||||
下载网站:https://golang.google.cn/dl/
|
||||
|
||||
进入网站后,根据不同的安装方式进行安装即可
|
||||
|
||||

|
||||
|
||||
这里选择 zip 的方式进行安装,下载好解压缩即可
|
||||
|
||||
## 配置环境变量
|
||||
|
||||
将 bin 目录添加到环境变量中
|
||||
|
||||

|
||||
|
||||
## 验证
|
||||
|
||||
打开 cmd 进行验证
|
||||
|
||||
```bash
|
||||
go version
|
||||
```
|
||||
|
||||
输出一下信息即代表配置成功
|
||||
|
||||
```
|
||||
go version go1.24.5 windows/amd64
|
||||
```
|
||||
|
||||
@@ -191,3 +191,35 @@ sudo apt install libgl1-mesa-glx
|
||||
|
||||
|
||||
|
||||
## all input arrays must have the same shap
|
||||
|
||||
### 问题原因
|
||||
|
||||
- 图像尺寸不一致
|
||||
|
||||
### 解决方案
|
||||
|
||||
将 batch_size_per_card 设置为 1
|
||||
|
||||
```yaml
|
||||
Eval:
|
||||
loader:
|
||||
batch_size_per_card: 1
|
||||
```
|
||||
|
||||
|
||||
|
||||
## OSError: cannot open resource
|
||||
|
||||
### 问题原因
|
||||
|
||||
- 字体路径无效
|
||||
|
||||
### 解决方案
|
||||
|
||||
将paddleocr里面的字体放到系统字体路径下,例如:
|
||||
|
||||
```bash
|
||||
cp /workspace/PaddleOCR-3.1.0/doc/fonts/simfang.ttf /usr/share/fonts/
|
||||
```
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
# 相关网站
|
||||
|
||||
- github:https://github.com/PaddleCV-SIG/PaddleLabel
|
||||
- 官网:
|
||||
|
||||
|
||||
|
||||
# 加载自定义模型
|
||||
|
||||
## 1. 修改 PPOCRLabel.py
|
||||
|
||||
```python
|
||||
params = {
|
||||
"use_doc_orientation_classify": False,
|
||||
"use_doc_unwarping": False,
|
||||
"use_textline_orientation": True,
|
||||
"device": self.gpu,
|
||||
"lang": self.lang,
|
||||
"text_detection_model_name": "PP-OCRv5_mobile_det", # 修改为自己的模型名称
|
||||
"text_recognition_model_name": "PP-OCRv5_mobile_rec", # 修改为自己的模型名称
|
||||
"enable_mkldnn": False,
|
||||
}
|
||||
|
||||
if det_model_dir is not None:
|
||||
params["text_detection_model_dir"] = det_model_dir
|
||||
if rec_model_dir is not None:
|
||||
params["text_recognition_model_dir"] = rec_model_dir
|
||||
if cls_model_dir is not None:
|
||||
params["text_line_orientation_model_dir"] = cls_model_dir
|
||||
|
||||
self.ocr = PaddleOCR(**params)
|
||||
self.text_recognizer = TextRecognition(
|
||||
model_name="PP-OCRv5_mobile_rec", # 修改为自己的模型名称
|
||||
model_dir=rec_model_dir,
|
||||
device=self.gpu,
|
||||
)
|
||||
self.text_detector = TextDetection(
|
||||
model_name="PP-OCRv5_mobile_det", # 修改为自己的模型名称
|
||||
model_dir=det_model_dir,
|
||||
device=self.gpu,
|
||||
)
|
||||
```
|
||||
|
||||
## 修改启动命令
|
||||
|
||||
```bash
|
||||
python PPOCRLabel.py --lang ch --kie True --det_model_dir "模型路径" --rec_model_dir "模型路径"
|
||||
|
||||
# 示例
|
||||
python PPOCRLabel.py --lang ch --kie True --det_model_dir ".\model\det_inference\" --rec_model_dir ".\model\rec_inference\"
|
||||
```
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
# 相关网站
|
||||
|
||||
- github:https://github.com/PaddleCV-SIG/PaddleLabel
|
||||
- 官网:
|
||||