Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,6 @@
|
|
2 |
|
3 |
from __future__ import annotations
|
4 |
|
5 |
-
import pathlib
|
6 |
-
|
7 |
import cv2
|
8 |
import gradio as gr
|
9 |
import huggingface_hub
|
@@ -64,14 +62,10 @@ def detect(image: np.ndarray) -> list[np.ndarray]:
|
|
64 |
person_images = visualize(image, bboxes, vbboxes)
|
65 |
return [img[:, :, ::-1] for img in person_images] # BGR -> RGB
|
66 |
|
67 |
-
examples = sorted(pathlib.Path("images").glob("*.jpg"))
|
68 |
-
|
69 |
demo = gr.Interface(
|
70 |
fn=detect,
|
71 |
inputs=gr.Image(label="Input", type="numpy"),
|
72 |
outputs=gr.Gallery(label="Detected Persons"),
|
73 |
-
examples=examples,
|
74 |
-
examples_per_page=30,
|
75 |
title=TITLE,
|
76 |
description=DESCRIPTION,
|
77 |
)
|
|
|
2 |
|
3 |
from __future__ import annotations
|
4 |
|
|
|
|
|
5 |
import cv2
|
6 |
import gradio as gr
|
7 |
import huggingface_hub
|
|
|
62 |
person_images = visualize(image, bboxes, vbboxes)
|
63 |
return [img[:, :, ::-1] for img in person_images] # BGR -> RGB
|
64 |
|
|
|
|
|
65 |
demo = gr.Interface(
|
66 |
fn=detect,
|
67 |
inputs=gr.Image(label="Input", type="numpy"),
|
68 |
outputs=gr.Gallery(label="Detected Persons"),
|
|
|
|
|
69 |
title=TITLE,
|
70 |
description=DESCRIPTION,
|
71 |
)
|