Spaces:
Runtime error
Runtime error
frgfm
commited on
Commit
·
b6322dc
1
Parent(s):
274d821
fix: Fixed typo
Browse files
app.py
CHANGED
|
@@ -12,12 +12,14 @@ import onnxruntime
|
|
| 12 |
from huggingface_hub import hf_hub_download
|
| 13 |
from PIL import Image
|
| 14 |
|
|
|
|
|
|
|
| 15 |
|
| 16 |
# Download model config & checkpoint
|
| 17 |
-
with open(hf_hub_download(
|
| 18 |
cfg = json.load(f)
|
| 19 |
|
| 20 |
-
ort_session = onnxruntime.InferenceSession(hf_hub_download(
|
| 21 |
|
| 22 |
def preprocess_image(pil_img: Image.Image) -> np.ndarray:
|
| 23 |
"""Preprocess an image for inference
|
|
|
|
| 12 |
from huggingface_hub import hf_hub_download
|
| 13 |
from PIL import Image
|
| 14 |
|
| 15 |
+
REPO = "pyronear/rexnet1_0x"
|
| 16 |
+
|
| 17 |
|
| 18 |
# Download model config & checkpoint
|
| 19 |
+
with open(hf_hub_download(REPO, filename="config.json"), "rb") as f:
|
| 20 |
cfg = json.load(f)
|
| 21 |
|
| 22 |
+
ort_session = onnxruntime.InferenceSession(hf_hub_download(REPO, filename="model.onnx"))
|
| 23 |
|
| 24 |
def preprocess_image(pil_img: Image.Image) -> np.ndarray:
|
| 25 |
"""Preprocess an image for inference
|