From 9497580dce74a99ad37f8adaf786fe859a6d78cd Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Fri, 21 May 2021 12:02:03 +0800 Subject: [PATCH] fix lable parse error when \r in the end of line --- ppocr/data/simple_dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppocr/data/simple_dataset.py b/ppocr/data/simple_dataset.py index ea57b785..8f8fcb4d 100644 --- a/ppocr/data/simple_dataset.py +++ b/ppocr/data/simple_dataset.py @@ -74,7 +74,7 @@ class SimpleDataSet(Dataset): data_line = self.data_lines[file_idx] try: data_line = data_line.decode('utf-8') - substr = data_line.strip("\n").split(self.delimiter) + substr = data_line.strip("\n").strip("\r").split(self.delimiter) file_name = substr[0] label = substr[1] img_path = os.path.join(self.data_dir, file_name) -- GitLab