Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import numpy as np
|
|
3 |
from PIL import Image
|
4 |
import cv2
|
5 |
import os
|
6 |
-
|
7 |
weight_path = r'basic.h5' #权重文件
|
8 |
model = load_model(weight_path)
|
9 |
|
@@ -22,7 +22,7 @@ def classify_image(inp):
|
|
22 |
confidences = {labels[i]: float(prediction[0][i]) for i in range(7)}
|
23 |
return confidences
|
24 |
|
25 |
-
|
26 |
fn=classify_image,
|
27 |
inputs=gr.Image(type="pil",shape=(256,256)),
|
28 |
outputs=gr.Label(num_top_classes=1),
|
|
|
3 |
from PIL import Image
|
4 |
import cv2
|
5 |
import os
|
6 |
+
import gradio as gr
|
7 |
weight_path = r'basic.h5' #权重文件
|
8 |
model = load_model(weight_path)
|
9 |
|
|
|
22 |
confidences = {labels[i]: float(prediction[0][i]) for i in range(7)}
|
23 |
return confidences
|
24 |
|
25 |
+
gr.Interface(
|
26 |
fn=classify_image,
|
27 |
inputs=gr.Image(type="pil",shape=(256,256)),
|
28 |
outputs=gr.Label(num_top_classes=1),
|