Spaces:
Runtime error
Runtime error
update
Browse files
app.py
CHANGED
@@ -30,7 +30,6 @@ def transform_image(img_sample):
|
|
30 |
|
31 |
def predict(Image):
|
32 |
tranformed_img = transform_image(Image)
|
33 |
-
"""
|
34 |
model.eval()
|
35 |
tranformed_img = transform_image(Image)
|
36 |
img = torch.from_numpy(tranformed_img)
|
@@ -42,18 +41,17 @@ def predict(Image):
|
|
42 |
for cat, value in zip(category, grade):
|
43 |
output_dict[cat] = value.item()
|
44 |
return output_dict
|
45 |
-
|
46 |
-
return tranformed_img
|
47 |
|
48 |
|
49 |
|
50 |
image = gr.Image(type="pil")#shape=(224, 224), image_mode="RGB")
|
51 |
-
|
52 |
|
53 |
demo = gr.Interface(
|
54 |
fn=predict,
|
55 |
inputs=image,
|
56 |
-
outputs=
|
57 |
#examples=["examples/0.png", "examples/1.png", "examples/2.png", "examples/3.png", "examples/4.png"]
|
58 |
)
|
59 |
|
|
|
30 |
|
31 |
def predict(Image):
|
32 |
tranformed_img = transform_image(Image)
|
|
|
33 |
model.eval()
|
34 |
tranformed_img = transform_image(Image)
|
35 |
img = torch.from_numpy(tranformed_img)
|
|
|
41 |
for cat, value in zip(category, grade):
|
42 |
output_dict[cat] = value.item()
|
43 |
return output_dict
|
44 |
+
|
|
|
45 |
|
46 |
|
47 |
|
48 |
image = gr.Image(type="pil")#shape=(224, 224), image_mode="RGB")
|
49 |
+
label = gr.Label(label="Grade")
|
50 |
|
51 |
demo = gr.Interface(
|
52 |
fn=predict,
|
53 |
inputs=image,
|
54 |
+
outputs=label,
|
55 |
#examples=["examples/0.png", "examples/1.png", "examples/2.png", "examples/3.png", "examples/4.png"]
|
56 |
)
|
57 |
|