Skip to content

Line and Word Segmentation for Bangla Handwritten Text Recognition

License

Notifications You must be signed in to change notification settings

crusnic-corp/BN-DRISHTI

Repository files navigation

PWC PWC PWC Generic badge Generic badge

BN-DRISHTI

BN-DRISHTI: Bangla Document Recognition through Instance-level Segmentation of Handwritten Text Images

How To Run The DEMO (Inferencing on Single Image):

  1. Open the BN_DRISHTI_DEMO.ipynb script and click on the Open In Colab Button.
  2. Run the script from Runtime -> Run All
  3. Download some Handwritings from the sample_image of the repository. Or supply your own.
  4. UPLOAD ONE Image (per-run) containing Handwritings (from your device) by clicking on Choose Files button once the cells are executing.

You can see different transitions/outputs by going through the cells.

Running Bulk Inferencing (on unannotated images):

  1. Open the BN_DRISHTI_Bulk_Inferencing.ipynb script from 'bulk_inferencing' folder and click on the Open In Colab Button.
  2. Run the script from Runtime -> Run All
  3. By default it is executed on the bulk_sample.zip data but you can supply your own .zip file through a link.
  4. The outputs will be saved on the temporary space in CoLab.
  5. You can also save the output on your google drive or download them as .zip by uncommenting either of the last two cells.

Reproducing Results on BN-HTRd Test Dataset (with ground truths):

  1. Open the BN_DRISHTI_Run_On_Test_Sets.ipynb script from 'test_scripts' folder and click on the Open In Colab Button.
  2. Run the script from Runtime -> Run All
  3. By default it is executed on the test.zip data but you can supply your own .zip file through a link.
  4. If you use your own dataset you also have to supply ground truths (please follow folder structure like test.zip).
  5. The outputs will be saved on the temporary space in CoLab.
  6. You can also save the output on your google drive or download them as .zip by uncommenting either of the last two cells.

MODEL Files:

  • The custom YOLOv5 models trained on the BN-HTRd Dataset for line and word segmentation will be automatically downloaded when you run the script.
  • If you want to download the Trained Models you can visit our Hugging Face Model Hub:
  • Try Out Live Demo for YOLO Models Only:
    • By Default the selected model will be Downloaded Automatically from our HuggingFace Model Hub.
    • You can also use your own model (.pt) file through File Upload option while running the demo.
      OR
    • You can paste the models Link directly to the URL option, for example:
      • Line Model: https://huggingface.co/crusnic/BN-DRISHTI/resolve/main/models/line_model_best.pt
      • Word Model: https://huggingface.co/crusnic/BN-DRISHTI/resolve/main/models/word_model_best.pt

Note: You will not be able to get perfect results by only using the YOLO models.

Dataset:

To Cite the Dataset Paper:

@incollection{rahman2023bn,
     title={BN-HTRd: A Benchmark Dataset for Document Level Offline Bangla Handwritten Text Recognition (HTR) and Line Segmentation},
     author={Rahman, Md Ataur and Tabassum, Nazifa and Paul, Mitu and Pal, Riya and Islam, Mohammad Khairul},
     booktitle={Computer Vision and Image Analysis for Industry 4.0},
     pages={1--16},
     year={2023},
     publisher={CRC Press 6000 Broken Sound Parkway NW, Suite 300, Boca Raton, FL 33487-2742}
}

To Cite the BN-DRISHTI Paper:

@InProceedings{10.1007/978-3-031-41501-2_14,
     author="Jubaer, Sheikh Mohammad and Tabassum, Nazifa and Rahman, Md Ataur and Islam, Mohammad Khairul",
     editor="Coustaty, Mickael and Forn{\'e}s, Alicia",
     title="BN-DRISHTI: Bangla Document Recognition Through Instance-Level Segmentation of Handwritten Text Images",
     booktitle="Document Analysis and Recognition -- ICDAR 2023 Workshops",
     year="2023",
     publisher="Springer Nature Switzerland",
     address="Cham",
     pages="195--212"
}