How hamdha-saheer/look-eyewear-recommendation works
LOOK is a face-shape and glasses recommendation web app with an image-based prediction flow and virtual try-on. Its Flask routes coordinate face detection, shape inference, recommendation lookup, and overlay generation; users can also request recommendations for a manually selected shape. The repository additionally includes dataset preparation and two model-training scripts. Dataset files and trained weights are not present in the tree, so those data relationships are shown only where supported by the excerpts.
Main entry points: app.py Flask routes · try_on.py Glasses overlay · model Trained weights · clean_data.py Dataset cleaning
Components 16
Web application
- Flask routes
app.py - Web interface
templates/index.html - Prediction and overlay response
app.py
Face vision
- Face processing
face_utils.py - Shape inference
app.py - Trained weights
model - Class mappings
model/classes_male.json
Recommendations and try-on
- Recommendation data
recommendations.json - Glasses images
static/glasses - Glasses overlay
try_on.py
Model development
- Dataset cleaning
clean_data.py - Class balancing
balance_data.py - Model training
train_model.py - Tracked training
train_model_mlflow.py - Image datasets
Other components
- User
Connections 19
- User → Web interface: uses
- Web interface → Flask routes: submits requests
app.py - Flask routes → Face processing: crops and landmarks
app.py - Flask routes → Shape inference: runs inference
app.py - Shape inference → Trained weights: loads weights
app.py - Shape inference → Class mappings: maps classes
app.py - Flask routes → Recommendation data: looks up recommendations
app.py - Flask routes → Glasses images: indexes images
app.py - Flask routes → Glasses overlay: requests overlay
app.py - Glasses overlay → Glasses images: reads PNG
try_on.py - Glasses overlay → Prediction and overlay response: writes image
try_on.py - Flask routes → Prediction and overlay response: returns JSON or image
app.py - Dataset cleaning → Face processing: crops images
clean_data.py - Dataset cleaning → Image datasets: writes cleaned splits
clean_data.py - Class balancing → Image datasets: balances training images
balance_data.py - Model training → Image datasets: loads cleaned splits
train_model.py - Tracked training → Image datasets: loads cleaned splits
train_model_mlflow.py - Model training → Trained weights: saves checkpoints
train_model.py - Tracked training → Trained weights: saves checkpoints and classes
train_model_mlflow.py