Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,7 @@ import huggingface_hub
|
|
8 |
import insightface
|
9 |
import numpy as np
|
10 |
import onnxruntime as ort
|
|
|
11 |
|
12 |
TITLE = "insightface Person Detection"
|
13 |
DESCRIPTION = "https://github.com/deepinsight/insightface/tree/master/examples/person_detection"
|
@@ -55,14 +56,12 @@ def detect(image: np.ndarray) -> list[np.ndarray]:
|
|
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"),
|
64 |
outputs=gr.Gallery(label="Detected Persons"), # Display multiple images in a gallery
|
65 |
examples=examples,
|
|
|
66 |
examples_per_page=30,
|
67 |
title=TITLE,
|
68 |
description=DESCRIPTION,
|
|
|
8 |
import insightface
|
9 |
import numpy as np
|
10 |
import onnxruntime as ort
|
11 |
+
from PIL import Image
|
12 |
|
13 |
TITLE = "insightface Person Detection"
|
14 |
DESCRIPTION = "https://github.com/deepinsight/insightface/tree/master/examples/person_detection"
|
|
|
56 |
|
57 |
examples = sorted(pathlib.Path("images").glob("*.jpg"))
|
58 |
|
|
|
|
|
|
|
59 |
demo = gr.Interface(
|
60 |
fn=detect,
|
61 |
inputs=gr.Image(label="Input", type="numpy"),
|
62 |
outputs=gr.Gallery(label="Detected Persons"), # Display multiple images in a gallery
|
63 |
examples=examples,
|
64 |
+
cache_examples=False, # Disable caching of examples
|
65 |
examples_per_page=30,
|
66 |
title=TITLE,
|
67 |
description=DESCRIPTION,
|