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