Spaces:
Sleeping
Sleeping
Henry Du
commited on
Commit
·
d939cad
1
Parent(s):
aba3a63
Update app.py
Browse files
app.py
CHANGED
@@ -37,8 +37,6 @@ def convert_img_to_tensor(img):
|
|
37 |
convert_img = convert_img.repeat(3, 1, 1)
|
38 |
return convert_img
|
39 |
|
40 |
-
|
41 |
-
|
42 |
def predict(img) -> Dict:
|
43 |
"""Transforms and performs a prediction on img and returns prediction.
|
44 |
"""
|
@@ -55,8 +53,6 @@ def predict(img) -> Dict:
|
|
55 |
# Create a prediction label and prediction probability dictionary for each prediction class (this is the required format for Gradio's output parameter)
|
56 |
pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}
|
57 |
|
58 |
-
# Calculate the prediction time
|
59 |
-
|
60 |
# Return the prediction dictionary and prediction time
|
61 |
return pred_labels_and_probs
|
62 |
|
|
|
37 |
convert_img = convert_img.repeat(3, 1, 1)
|
38 |
return convert_img
|
39 |
|
|
|
|
|
40 |
def predict(img) -> Dict:
|
41 |
"""Transforms and performs a prediction on img and returns prediction.
|
42 |
"""
|
|
|
53 |
# Create a prediction label and prediction probability dictionary for each prediction class (this is the required format for Gradio's output parameter)
|
54 |
pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}
|
55 |
|
|
|
|
|
56 |
# Return the prediction dictionary and prediction time
|
57 |
return pred_labels_and_probs
|
58 |
|