Spaces:
Build error
Build error
second commit
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
import torch
|
| 4 |
-
from model import
|
| 5 |
from timeit import default_timer as timer
|
| 6 |
from typing import Tuple,Dict
|
| 7 |
|
|
@@ -15,7 +15,7 @@ def predict(img)-> Tuple[Dict,float]:
|
|
| 15 |
effnetb2.eval()
|
| 16 |
with torch.inference_mode():
|
| 17 |
pred_probs=torch.softmax(effnetb2(img),dim=1)
|
| 18 |
-
pred_labels_and_probs={class_names[i]:float(pred_probs[0][i] for i in range(len(class_names))
|
| 19 |
pred_time=round(timer()-start_timer,5)
|
| 20 |
return pred_labels_and_probs,pred_time
|
| 21 |
title="FoodVision"
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
import torch
|
| 4 |
+
from model import create_effnetb2_model
|
| 5 |
from timeit import default_timer as timer
|
| 6 |
from typing import Tuple,Dict
|
| 7 |
|
|
|
|
| 15 |
effnetb2.eval()
|
| 16 |
with torch.inference_mode():
|
| 17 |
pred_probs=torch.softmax(effnetb2(img),dim=1)
|
| 18 |
+
pred_labels_and_probs={class_names[i]:float(pred_probs[0][i]) for i in range(len(class_names))}
|
| 19 |
pred_time=round(timer()-start_timer,5)
|
| 20 |
return pred_labels_and_probs,pred_time
|
| 21 |
title="FoodVision"
|