Deep Learning based model to predict the Typeface used in a given image.
Click here for an interactive front-end demo.
The "demo samples" folder contains sample images, which can be used to test the model.
Click here to view the source code for training and testing the model.
This project has been tested with Python 3.10 - Python 3.14.
-
Create an environment:
...using
venv:python -m venv venv
...using
conda:conda create -n typeface-recognition-frontend python=3.14
...or using any other environment manager of your choice.
-
Install PyTorch, as per the official instructions.
-
Install remaining requirements:
pip install -r requirements.txt
-
Launch the app
streamlit run app.py
The model has an accuracy of 78.02% in predicting the typeface used.
Shown below is a Confusion Matrix for the letter P rendered using all
typefaces. The y-axis denotes the Typeface used, and the x-axis denotes the
prediction by the model. The near-perfect diagonal line indicates that the model
is very accurate in predicting the typeface used for the given letter.
Shown below is the model architecture:

