Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,8 +6,9 @@ import cv2
|
|
| 6 |
import json
|
| 7 |
import gradio as gr
|
| 8 |
from huggingface_hub import hf_hub_download
|
|
|
|
| 9 |
|
| 10 |
-
hf_hub_download(repo_id="onnx/EfficientNet-Lite4", filename="efficientnet-lite4-11.onnx")
|
| 11 |
# load the labels text file
|
| 12 |
labels = json.load(open("labels_map.txt", "r"))
|
| 13 |
|
|
@@ -46,12 +47,7 @@ def center_crop(img, out_height, out_width):
|
|
| 46 |
img = img[top:bottom, left:right]
|
| 47 |
return img
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
import onnxruntime as rt
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
sess = rt.InferenceSession('efficientnet-lite4-11.onnx')
|
| 55 |
|
| 56 |
def inference(img):
|
| 57 |
img = cv2.imread(img)
|
|
|
|
| 6 |
import json
|
| 7 |
import gradio as gr
|
| 8 |
from huggingface_hub import hf_hub_download
|
| 9 |
+
import onnxruntime as rt
|
| 10 |
|
| 11 |
+
modele = hf_hub_download(repo_id="onnx/EfficientNet-Lite4", filename="efficientnet-lite4-11.onnx")
|
| 12 |
# load the labels text file
|
| 13 |
labels = json.load(open("labels_map.txt", "r"))
|
| 14 |
|
|
|
|
| 47 |
img = img[top:bottom, left:right]
|
| 48 |
return img
|
| 49 |
|
| 50 |
+
sess = rt.InferenceSession(modele)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
def inference(img):
|
| 53 |
img = cv2.imread(img)
|