Spaces:
Sleeping
Sleeping
Commit
·
30ff8c5
1
Parent(s):
082adb2
Upload app.py
Browse files
app.py
CHANGED
@@ -27,10 +27,7 @@ url = "https://drive.google.com/uc?id=12700bE-pomYKoVQ214VrpBoJ7akXcTpL"
|
|
27 |
output = "modelV2Lmixed.keras"
|
28 |
gdown.download(url, output, quiet=False)
|
29 |
|
30 |
-
|
31 |
-
def load_model():
|
32 |
-
model = tf.keras.models.load_model("./modelV2Lmixed.keras")
|
33 |
-
return model
|
34 |
|
35 |
|
36 |
def classify_image(image, model):
|
@@ -38,11 +35,8 @@ def classify_image(image, model):
|
|
38 |
image = tf.image.resize(image, [32, 32])
|
39 |
image = np.expand_dims(image, axis=0)
|
40 |
prediction = model.predict(image)
|
41 |
-
confidences = {labels[i]: float(prediction[i]) for i in range(10)}
|
42 |
-
return
|
43 |
-
|
44 |
-
|
45 |
-
model = load_model()
|
46 |
|
47 |
|
48 |
gr.Interface(fn=classify_image,
|
|
|
27 |
output = "modelV2Lmixed.keras"
|
28 |
gdown.download(url, output, quiet=False)
|
29 |
|
30 |
+
model = tf.keras.models.load_model("./modelV2Lmixed.keras")
|
|
|
|
|
|
|
31 |
|
32 |
|
33 |
def classify_image(image, model):
|
|
|
35 |
image = tf.image.resize(image, [32, 32])
|
36 |
image = np.expand_dims(image, axis=0)
|
37 |
prediction = model.predict(image)
|
38 |
+
#confidences = {labels[i]: float(prediction[i]) for i in range(10)}
|
39 |
+
return prediction
|
|
|
|
|
|
|
40 |
|
41 |
|
42 |
gr.Interface(fn=classify_image,
|