Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
"""
|
| 2 |
-
FaceAge
|
| 3 |
|
| 4 |
Face detection : YuNet (OpenCV built-in, ~350 KB model, no extra deps)
|
| 5 |
-
Age/gender : FaceAge
|
| 6 |
"""
|
| 7 |
import os
|
| 8 |
import numpy as np
|
|
@@ -60,7 +60,7 @@ def _load_age_model():
|
|
| 60 |
|
| 61 |
print("[AgeModel] Downloading ONNX from HuggingFace Hub β¦")
|
| 62 |
onnx_path = hf_hub_download(
|
| 63 |
-
repo_id = "TrungTran/faceage-
|
| 64 |
filename = "faceage_dino_fp32.onnx",
|
| 65 |
token = _HF_TOKEN,
|
| 66 |
)
|
|
@@ -269,9 +269,9 @@ def predict(image: Image.Image, max_faces: int,
|
|
| 269 |
# ---------------------------------------------------------------------------
|
| 270 |
|
| 271 |
_DESC = """
|
| 272 |
-
## FaceAge
|
| 273 |
|
| 274 |
-
Upload a photo. **YuNet** auto-detects faces, then **FaceAge
|
| 275 |
|
| 276 |
| | |
|
| 277 |
|--|--|
|
|
@@ -280,10 +280,10 @@ Upload a photo. **YuNet** auto-detects faces, then **FaceAge-DINOv3** predicts a
|
|
| 280 |
| β‘ Speed | ~100 ms / face on CPU (ONNX FP32) |
|
| 281 |
| π Detector | YuNet (OpenCV, ~350 KB) |
|
| 282 |
|
| 283 |
-
[π Model Card](https://huggingface.co/TrungTran/faceage-
|
| 284 |
"""
|
| 285 |
|
| 286 |
-
with gr.Blocks(title="FaceAge
|
| 287 |
gr.Markdown(_DESC)
|
| 288 |
|
| 289 |
with gr.Row():
|
|
|
|
| 1 |
"""
|
| 2 |
+
FaceAge ClientScan β Gradio demo for HuggingFace Spaces.
|
| 3 |
|
| 4 |
Face detection : YuNet (OpenCV built-in, ~350 KB model, no extra deps)
|
| 5 |
+
Age/gender : FaceAge ClientScan ONNX (CPU, ~1.2 GB)
|
| 6 |
"""
|
| 7 |
import os
|
| 8 |
import numpy as np
|
|
|
|
| 60 |
|
| 61 |
print("[AgeModel] Downloading ONNX from HuggingFace Hub β¦")
|
| 62 |
onnx_path = hf_hub_download(
|
| 63 |
+
repo_id = "TrungTran/faceage-clientscan",
|
| 64 |
filename = "faceage_dino_fp32.onnx",
|
| 65 |
token = _HF_TOKEN,
|
| 66 |
)
|
|
|
|
| 269 |
# ---------------------------------------------------------------------------
|
| 270 |
|
| 271 |
_DESC = """
|
| 272 |
+
## FaceAge ClientScan β Age & Gender Estimation
|
| 273 |
|
| 274 |
+
Upload a photo. **YuNet** auto-detects faces, then **FaceAge ClientScan** predicts age and gender.
|
| 275 |
|
| 276 |
| | |
|
| 277 |
|--|--|
|
|
|
|
| 280 |
| β‘ Speed | ~100 ms / face on CPU (ONNX FP32) |
|
| 281 |
| π Detector | YuNet (OpenCV, ~350 KB) |
|
| 282 |
|
| 283 |
+
[π Model Card](https://huggingface.co/TrungTran/faceage-clientscan)
|
| 284 |
"""
|
| 285 |
|
| 286 |
+
with gr.Blocks(title="FaceAge ClientScan", theme=gr.themes.Soft()) as demo:
|
| 287 |
gr.Markdown(_DESC)
|
| 288 |
|
| 289 |
with gr.Row():
|