lifespan-predictor / README.md
SiyaYan's picture
Update readme.md
b907abc verified
---
title: Lifespan Predictor
emoji: 📚
colorFrom: red
colorTo: pink
sdk: gradio
sdk_version: 5.44.1
app_file: app.py
pinned: false
license: mit
short_description: remaining lifespan predictor
---
# 🧑‍⚕️ Lifespan Prediction Demo
This is a **Gradio app** that predicts the **remaining lifespan (in years)** from a face image using a fine-tuned [DINOv2](https://github.com/facebookresearch/dinov2) model.
The model was trained on the [Remaining Lifespan Prediction Faces](https://huggingface.co/datasets/TristanKE/RemainingLifespanPredictionFaces) dataset.
---
## 🚀 How it works
- Upload a face photo **or** use your **webcam**.
- The model extracts features with a **DINOv2 ViT-L backbone**.
- A regression head outputs the predicted **remaining lifespan (years)**.
---
## 🖥️ Usage
1. Click **“Use Webcam”** or **“Upload Image”**.
2. Wait a few seconds for processing (faster on GPU).
3. The result will be shown in the output box:
Estimated remaining lifespan: XX.X years
---
## ⚙️ Technical Details
- Backbone: `dinov2_vitl14_reg` (frozen during training)
- Hidden dimension: `128`
- Loss: **Heteroscedastic Negative Log Likelihood (NLL)**
- Best checkpoint saved during training → uploaded to [Model Hub](https://huggingface.co/SiyaYan/lifespan-predictor).
---
## 📦 Files in this Space
- `app.py` → Gradio app definition
- `requirements.txt` → dependencies
- `README.md` → this file
---
## ⚠️ Disclaimer
This demo is for **research and educational purposes only**.
Predictions are **not medical advice** and should not be used in real-world decision-making.
---