This is a hand-drawn image recognition application based on the Tkinter and PIL libraries. Users can draw digits or letters within the application and make predictions using a pre-trained MNIST model or a custom-trained model.
git clone https://github.com/Luffy1225/Predict_What_You_Draw_TensorFLow.git
cd Predict_What_You_Draw_TensorFLow
pip install -r requirements.txt
Important
Before running, ensure that the images folder exists (otherwise, the corresponding training set cannot be found).
You can extract the provided images_DATE archive and rename it to images.
python main.py
python AIModel.py
python FolderManager.py
-
Drawing Canvas: Users can freely draw digits on the canvas provided by the application.
-
Model Selection: Multiple pre-trained models are available for users to choose from and switch between for predictions.
Note
It is recommended to use the mnist_model_Epoch_100.keras model.
-
Prediction Result Display: The application displays the predicted digit below the canvas.
-
Clear Canvas: Users can clear all content on the canvas to redraw digits.
-
Save Image (Right click): Drawn images can be saved as part of the training set. You can also using this feature for making your own dataset.
images/
├── ignore/ # Ignored data, not used for training or testing
│ ├── label_1/ # Images for label 1
│ │ ├── 0.jpg # Image file
│ │ ├── 1.jpg
│ │ └── ... # More images
│ ├── label_2/ # Images for label 2
│ │ ├── 0.jpg
│ │ ├── 1.jpg
│ │ └── ...
│ └── label_x/ # Images for other labels
│ ├── 0.jpg
│ ├── 1.jpg
│ └── ...
├── test/ # Test data, used for validating the model
│ ├── label_1/ # Test images for label 1
│ │ ├── 0.jpg
│ │ ├── 1.jpg
│ │ └── ...
│ ├── label_2/ # Test images for label 2
│ │ ├── 0.jpg
│ │ ├── 1.jpg
│ │ └── ...
│ └── label_x/ # Test images for other labels
│ ├── 0.jpg
│ ├── 1.jpg
│ └── ...
├── train/ # Training data, used for training the model
│ ├── label_1/ # Training images for label 1
│ │ ├── 0.jpg
│ │ ├── 1.jpg
│ │ └── ...
│ ├── label_2/ # Training images for label 2
│ │ ├── 0.jpg
│ │ ├── 1.jpg
│ │ └── ...
│ └── label_x/ # Training images for other labels
│ ├── 0.jpg
│ ├── 1.jpg
│ └── ...