YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Flask Web App - Usage Guide
Quick Start
1. Install Dependencies
pip install flask torch torchvision tenseal matplotlib scikit-learn pandas
2. Train the Model (if not already done)
python encrypted_inference.py
This will create classifier_weights.pth needed by the Flask app.
3. Start the Flask Server
python app.py
4. Open in Browser
Navigate to: http://localhost:5000
Features
- Drag & Drop Upload: Modern UI with drag-and-drop image upload
- Encrypted Classification: Uses TenSEAL for privacy-preserving inference
- Real-time Results: See predictions with confidence scores
- Encryption Visualization: View encrypted logits and inference time
How It Works
- User uploads an artwork image
- ResNet18 extracts 512 features from the image
- Features are encrypted using CKKS homomorphic encryption
- Server performs classification on encrypted data
- Result is decrypted and displayed to the user
Project Structure
project/
βββ app.py # Flask backend
βββ encrypted_inference.py # Training script
βββ classifier_weights.pth # Trained model weights
βββ templates/
β βββ index.html # Upload page
β βββ result.html # Results page
βββ static/
βββ style.css # Styling
βββ uploads/ # Uploaded images
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support