Welcome to our Champlain Hackathon 2025 project! This app uses deep learning to classify images of waste into organic or recycling categories. Perfect for building smarter recycling solutions! 🌱♻️
- Image Classification: Upload or provide a URL to an image of trash.
- Real-time Predictions: Get results instantly via a Flask API.
- Confidence Scores: See how confident the model is about its prediction.
- Easy Integration: Use the
classify_image()function directly in Python.
- The model is a custom LeNet CNN built with PyTorch.
- Images are resized to 128x128, normalized, and passed through the model.
- The model outputs probabilities for each class:
organicorrecycling. - Results include predicted class and confidence.
- Python 3.8+
- PyTorch
- torchvision
- Flask
- Pillow
- requests
pip install torch torchvision flask pillow requests flask-corspython backend.pyOpen your browser at http://localhost:65535 to access the web interface.
Send a POST request to /predict with:
- image (file upload)
- url (image URL)
- image_data (base64 string)
Example using Python requests:
import requests
url = 'http://localhost:65535/predict'
files = {'image': open('trash.jpg', 'rb')}
response = requests.post(url, files=files)
print(response.json())from backend import classify_image
result = classify_image('trash.jpg')
print(result)organic🌿recycling♻️
Have fun sorting trash with AI! 😎