- The images folder contain all the cropped images and preprocessing descriptions
- train.ipynb contains the scripts. Currently its a bit unreadable... will refactor later.
- recover around 1000 images!!! wasted during preprocessing
- this was trained using raw images... should try training it using processed images(they look better in quality)
-
Use the weights expr/FinalnetCRNN_249_105.pth
-
Run demo
python demo.py -m path/to/model/expr/FinalnetCRNN_249_105.pth -i demo/উত্তরাধিকার_82.jpg
Expected output
উ-----তত্্্তররাাধিিককাাারর => উত্তরাধিকার
-
Put your images in a folder and organize your images in the following format:
label_number.jpg
For example:
- English
hi_0.jpg hello_1.jpg English_2.jpg English_3.jpg E n g l i s h_4.jpg...
- Bengali
উত্তরাধিকার_82.jpg দেশপ্রেমের_70.jpg দেশের_13.jpg ধূলিকণায়_16.jpg বিশাল_6.jpg ...
The numbers are used to distinguish the same labels.
-
Run the
create_dataset.py
intool
folder bypython tool/create_dataset.py --out lmdb/data/output/path --folder path/to/folder
-
Use the same step to create train and val data.
-
The advantage of the folder mode is that it's convenient! But due to some illegal character can't be in the path
So the disadvantage of the folder mode is that it's labels are limited.
-
Your data file should like
absolute/path/to/image/উত্তরাধিকার_82.jpg উত্তরাধিকার_82 absolute/path/to/image/দেশপ্রেমের_70.jpg দেশপ্রেমের_70 absolute/path/to/image/দেশের_13.jpg দেশের_13 absolute/path/to/image/ধূলিকণায়_16.jpg ধূলিকণায় absolute/path/to/image/বিশাল_6.jpg বিশাল_6 absolute/path/to/image/xxx.jpg label of xxx.jpg . . .
DO REMEMBER:
- It must be the absolute path to image.
- The first line can't be empty.
- There are no blank line between two data.
-
Run the
create_dataset.py
intool
folder bypython tool/create_dataset.py --out lmdb/data/output/path --file path/to/file
-
Use the same step to create train and val data.
Parameters and alphabets can't always be the same in different situation.
-
Change parameters
Your can see the
params.py
in detail. -
Change alphabets
Please put all the alphabets appeared in your labels to
alphabets.py
, or the program will throw error during training process.
Run train.py
by
python train.py --trainroot path/to/train/dataset --valroot path/to/val/dataset
- Python3.6.5
- torch==1.2.0
- torchvision==0.4.0