Spaces:
Running
Running
Irina Tolstykh
commited on
Commit
·
ce0031d
1
Parent(s):
71a75ca
update name
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ import subprocess
|
|
| 7 |
if os.getenv('SYSTEM') == 'spaces':
|
| 8 |
GITHUB_TOKEN = os.getenv('GITHUB_TOKEN')
|
| 9 |
GITHUB_USER = os.getenv('GITHUB_USER')
|
| 10 |
-
git_repo = f"https://{GITHUB_TOKEN}@github.com/{GITHUB_USER}/
|
| 11 |
subprocess.call(shlex.split(f'pip install git+{git_repo}'))
|
| 12 |
|
| 13 |
import pathlib
|
|
@@ -18,7 +18,7 @@ import numpy as np
|
|
| 18 |
import functools
|
| 19 |
from dataclasses import dataclass
|
| 20 |
|
| 21 |
-
from
|
| 22 |
|
| 23 |
|
| 24 |
@dataclass
|
|
@@ -34,7 +34,7 @@ class Cfg:
|
|
| 34 |
DESCRIPTION = """
|
| 35 |
# MiVOLO: Multi-input Transformer for Age and Gender Estimation
|
| 36 |
|
| 37 |
-
This is an official demo.
|
| 38 |
"""
|
| 39 |
|
| 40 |
HF_TOKEN = os.getenv('HF_TOKEN')
|
|
@@ -84,9 +84,11 @@ def detect(
|
|
| 84 |
detected_objects, out_im = predictor.recognize(image)
|
| 85 |
return out_im[:, :, ::-1] # BGR -> RGB
|
| 86 |
|
|
|
|
| 87 |
def clear():
|
| 88 |
return None, 0.4, 0.7, "Use persons and faces", None
|
| 89 |
|
|
|
|
| 90 |
predictor = load_models()
|
| 91 |
|
| 92 |
image_dir = pathlib.Path('images')
|
|
|
|
| 7 |
if os.getenv('SYSTEM') == 'spaces':
|
| 8 |
GITHUB_TOKEN = os.getenv('GITHUB_TOKEN')
|
| 9 |
GITHUB_USER = os.getenv('GITHUB_USER')
|
| 10 |
+
git_repo = f"https://{GITHUB_TOKEN}@github.com/{GITHUB_USER}/MiVOLO.git"
|
| 11 |
subprocess.call(shlex.split(f'pip install git+{git_repo}'))
|
| 12 |
|
| 13 |
import pathlib
|
|
|
|
| 18 |
import functools
|
| 19 |
from dataclasses import dataclass
|
| 20 |
|
| 21 |
+
from mivolo.predictor import Predictor
|
| 22 |
|
| 23 |
|
| 24 |
@dataclass
|
|
|
|
| 34 |
DESCRIPTION = """
|
| 35 |
# MiVOLO: Multi-input Transformer for Age and Gender Estimation
|
| 36 |
|
| 37 |
+
This is an official demo for https://github.com/WildChlamydia/MiVOLO.
|
| 38 |
"""
|
| 39 |
|
| 40 |
HF_TOKEN = os.getenv('HF_TOKEN')
|
|
|
|
| 84 |
detected_objects, out_im = predictor.recognize(image)
|
| 85 |
return out_im[:, :, ::-1] # BGR -> RGB
|
| 86 |
|
| 87 |
+
|
| 88 |
def clear():
|
| 89 |
return None, 0.4, 0.7, "Use persons and faces", None
|
| 90 |
|
| 91 |
+
|
| 92 |
predictor = load_models()
|
| 93 |
|
| 94 |
image_dir = pathlib.Path('images')
|