A web application that classifies images of Avengers characters using a machine learning model. Upload an image, and the app will predict which Avenger it is, displaying probability scores for each character.
- Upload an image and classify it as one of the Avengers (Bruce Banner, Clint Barton, Natasha Romanoff, Steve Rogers, Thor Odinson, Tony Stark).
- Displays probability scores for each character.
- Clean, modern UI with drag-and-drop image upload.
- Model success rate of ~70%
.
├── model/ # Model training, saved model, and requirements
│ ├── Avengers_Classifier_Model.ipynb
│ ├── saved_model.pkl
│ ├── class_dictionary.json
│ ├── requirements.txt
│ └── ...
├── server/ # Backend Flask server
│ ├── server.py
│ ├── util.py
│ └── ...
├── UI/ # Frontend files
│ ├── app.html
│ ├── app.js
│ ├── app.css
│ ├── dropzone.min.js
│ ├── dropzone.min.css
│ └── images/
├── GIF_Demo.gif # Demo GIF
├── ui_snapshot.png # UI Screenshot
└── ...
git clone https://github.com/Abhay-Mmmm/Avengers-Classifier.git
cd Abhay's AvengerClassifier-
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r model/requirements.txt pip install flask flask-cors
-
Run the Flask server:
cd server python server.pyThe server will start at
http://localhost:5000.
-
Open the UI:
- Open
UI/app.htmldirectly in your browser. - Make sure the Flask server is running in the background.
- Open
-
(Optional) Serve the UI with a local server:
- You can use any static server (like
http-serverfor Node.js or Python'shttp.server). - Example with Python:
Then visit
cd UI python -m http.server 8000http://localhost:8000/app.html.
- You can use any static server (like
- Drag and drop an image of an Avenger or click to upload.
- Click the "Classify" button.
- The predicted character and probability scores will be displayed.
- Ensure all images in
UI/images/are present for the UI to display correctly. - The backend uses a pre-trained model (
model/saved_model.pkl). If you wish to retrain, use the Jupyter notebook inmodel/Avengers_Classifier_Model.ipynb. - The server expects images in base64 format from the frontend.
- Python 3.x
- Flask
- Flask-CORS
- PyWavelets
- OpenCV (
opencv-python,opencv-python-headless) - Seaborn
Install all Python dependencies with:
pip install -r model/requirements.txt
pip install flask flask-corsMade with ❤️ by Abhay

