How nazil-the-professor/hair-analysis-tool works
This is a Flask-based hair-analysis web app. Users open a page and upload an image for either hairline/coverage visualization or scalp-segmentation heatmap analysis; the app returns JSON results and generated imagery. The sampled code shows page routes, YOLO-based overlay processing, and a TensorFlow Lite segmentation path with density calculations. The README also describes batch processing, but the tree and excerpts do not establish an implementation path for it. The excerpt omits some route bodies and model initialization, so uncertain links are not asserted.
Main entry points: app.py Flask routes · index.html Home page · upload_image.html Upload page · best.pt YOLO weights
Components 13
Web interface
- Flask routes
app.py - Home page
templates/index.html - Upload page
templates/upload_image.html
Hairline analysis
- Hairline detection
app.py - YOLO weights
best.pt - Overlay and metrics
app.py - Coverage view
templates/cvg.html
Scalp heatmaps
- Hair segmentation
app.py - Segmentation model
selfie_multiclass_256x256.tflite - Density calculation
app.py - Heatmap generation
app.py - Heatmap view
templates/heatmap_image.html
Other components
- Image user
Connections 12
- Image user → Flask routes: uploads image
app.py - Flask routes → Home page: renders
app.py - Flask routes → Upload page: renders
app.py - Flask routes → Hairline detection: dispatches
app.py - Hairline detection → YOLO weights: uses weights
- Hairline detection → Overlay and metrics: generates overlay
app.py - Flask routes → Coverage view: renders
- Flask routes → Hair segmentation: dispatches
app.py - Hair segmentation → Segmentation model: loads model
app.py - Flask routes → Heatmap generation: requests heatmaps
app.py - Heatmap generation → Density calculation: calculates density
app.py - Flask routes → Heatmap view: renders