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