Skip to content

Commit 5ca140a

Browse files
committed
* 制作箱号识别模型时去除空白字符
1 parent 3c8e4fa commit 5ca140a

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

CONTRIBUTING.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
### 更新日志
22

3-
#### DatasetToolsV1.0.9 - 2023-03-13
4-
* 更新集装箱箱型判断的规则
3+
#### DatasetToolsV1.1.0 - 2023-03-13
4+
* 制作箱号识别模型时去除空白字符
55
---
6-
76
<details onclose>
87
<summary>查看更多更新日志</summary>
98

9+
10+
#### DatasetToolsV1.0.9 - 2023-03-13
11+
* 更新集装箱箱型判断的规则
12+
---
13+
1014
#### DatasetToolsV1.0.8 - 2023-03-13
1115
* 更新获取版本号方法
1216
---

dataset_tools/jade_create_paddle_ocr_datasets.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def createOCRDatasets(self, label_txt_path):
359359
all_image_height = all_image_height + txt_img.shape[0]
360360
all_image_count = all_image_count + 1
361361
with open(os.path.join(save_h_detail_path, "rec_gt_test.txt"), "ab") as f:
362-
content = "test/" + image_name + "\t " + txt
362+
content = "test/" + image_name + "\t" + txt
363363
f.write((content + "\n").encode("utf-8"))
364364
else:
365365
txt_img = (txt_img * 255).astype("uint8")
@@ -370,7 +370,7 @@ def createOCRDatasets(self, label_txt_path):
370370
all_image_height = all_image_height + txt_img.shape[0]
371371
all_image_count = all_image_count + 1
372372
with open(os.path.join(save_v_detail_path, "rec_gt_test.txt"), "ab") as f:
373-
content = "test/" + image_name + "\t " + txt
373+
content = "test/" + image_name + "\t" + txt
374374
f.write((content + "\n").encode("utf-8"))
375375
else:
376376
if h < w:
@@ -380,7 +380,7 @@ def createOCRDatasets(self, label_txt_path):
380380
all_image_height = all_image_height + txt_img.shape[0]
381381
all_image_count = all_image_count + 1
382382
with open(os.path.join(save_h_detail_path, "rec_gt_train.txt"), "ab") as f:
383-
content = "train/" + image_name + "\t " + txt
383+
content = "train/" + image_name + "\t" + txt
384384
f.write((content + "\n").encode("utf-8"))
385385
else:
386386
txt_img = (txt_img * 255).astype("uint8")
@@ -391,7 +391,7 @@ def createOCRDatasets(self, label_txt_path):
391391
cv2.imencode('.jpg', txt_img)[1].tofile(
392392
os.path.join(save_v_detail_train_path, image_name))
393393
with open(os.path.join(save_v_detail_path, "rec_gt_train.txt"), "ab") as f:
394-
content = "train/" + image_name + "\t " + txt
394+
content = "train/" + image_name + "\t" + txt
395395
f.write((content + "\n").encode("utf-8"))
396396
else:
397397
if txt_orignal != "difficult":

0 commit comments

Comments
 (0)