GabrielDornelles / pytorch-ocr

Simple Pytorch framework to train OCRs. Supports CRNNs, Attention, CTC and Cross Entropy Loss.
MIT License
70 stars 16 forks source link

use os path to get file name cross-platform #7

Closed goodwin64 closed 10 months ago

goodwin64 commented 10 months ago

fixes wrong captcha labels on Windows OS - when it's prefixed with dirname

before the fix (notice extra char \\ in classes list and ground truth labels):

Screenshot 2023-11-11 000717

after the fix:

Screenshot 2023-11-11 000933

tested on MacOS as well 👍

GabrielDornelles commented 10 months ago

Nice find! I usually run things only on linux, but I'm trying to fix this old bad habit of using / instead of os.sep or os.path.join