This repository contains the source code for a skin condition analysis application, built using PyTorch and Tkinter. The application provides a user-friendly GUI where users can upload images of skin conditions, and the model predicts whether the condition is related to bags, redness, or acne. Based on the prediction, the application recommends specific skincare products tailored to treat the identified condition, leveraging a trained Vision Transformer model for accurate predictions.
Glowbot(1).ipynb: Jupyter notebook detailing the process of training, validating, and testing the model on skin condition images.glowbot.py: Python script for the GUI application that uses the trained model to perform predictions and display skincare product recommendations.vision_transformer_architecture.png: Visual representation of the model architecture
First step is always to run the glowbot(1).ipynb file and export the model, the file name will be - full_model.pth
To run the application directly from the Python script, follow these steps:
- Ensure Python 3.8 or higher is installed on your system.
- Install required dependencies:
pip install torch torchvision pillow tkinter
- Place the full_model.pth file in the same directory as the glowbot.py script.
- Run the script:
python glowbot.py
This will open the GUI where you can upload an image and receive predictions and recommendations.
To build an executable from the Python script using PyInstaller, follow these steps:
- Install PyInstaller if not already installed:
pip install pyinstaller
- Navigate to the directory containing glowbot.py.
- Run PyInstaller to create the executable:
pyinstaller --onefile --windowed glowbot.py
- Once the build process is complete, find the executable in the dist directory.
- Run the executable directly by double-clicking on it in the dist directory. Ensure full_model.pth is in the same directory as the executable for it to function correctly.
- The application has been tested on Windows 10 and macOS, but should be compatible with any operating system that supports Python and the required libraries.
- Make sure the image uploaded is in JPEG or PNG format for best results.