Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ def load_model():
|
|
28 |
def detect_person(
|
29 |
img: np.ndarray, detector: insightface.model_zoo.retinaface.RetinaFace
|
30 |
) -> np.ndarray:
|
31 |
-
bboxes,
|
32 |
bboxes = np.round(bboxes[:, :4]).astype(int)
|
33 |
return bboxes
|
34 |
|
@@ -55,6 +55,9 @@ def detect(image: np.ndarray) -> list[np.ndarray]:
|
|
55 |
|
56 |
examples = sorted(pathlib.Path("images").glob("*.jpg"))
|
57 |
|
|
|
|
|
|
|
58 |
demo = gr.Interface(
|
59 |
fn=detect,
|
60 |
inputs=gr.Image(label="Input", type="numpy"),
|
|
|
28 |
def detect_person(
|
29 |
img: np.ndarray, detector: insightface.model_zoo.retinaface.RetinaFace
|
30 |
) -> np.ndarray:
|
31 |
+
bboxes, _ = detector.detect(img)
|
32 |
bboxes = np.round(bboxes[:, :4]).astype(int)
|
33 |
return bboxes
|
34 |
|
|
|
55 |
|
56 |
examples = sorted(pathlib.Path("images").glob("*.jpg"))
|
57 |
|
58 |
+
# Forcing PNG format
|
59 |
+
gr.processing_utils.ENCODING_FORMAT = "PNG"
|
60 |
+
|
61 |
demo = gr.Interface(
|
62 |
fn=detect,
|
63 |
inputs=gr.Image(label="Input", type="numpy"),
|