Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,15 +2,14 @@ import gradio as gr
|
|
| 2 |
import tensorflow as tf
|
| 3 |
import numpy as np
|
| 4 |
from PIL import Image
|
| 5 |
-
import spaces
|
| 6 |
|
| 7 |
-
# Load model (
|
| 8 |
-
model = tf.keras.models.load_model('cat_model.
|
| 9 |
|
| 10 |
classes = ["Abyssinian", "Bengal", "Bombay", "British Shorthair", "Domestic",
|
| 11 |
"Maine Coon", "Persian", "Ragdoll", "Siamese", "Sphynx"]
|
| 12 |
|
| 13 |
-
# Dekorator ini wajib ada agar fungsinya bisa jalan di ZeroGPU
|
| 14 |
@spaces.GPU
|
| 15 |
def predict_cat(image):
|
| 16 |
if image is None:
|
|
|
|
| 2 |
import tensorflow as tf
|
| 3 |
import numpy as np
|
| 4 |
from PIL import Image
|
| 5 |
+
import spaces
|
| 6 |
|
| 7 |
+
# Load model dengan format .keras (format modern, bebas bug Flatten)
|
| 8 |
+
model = tf.keras.models.load_model('cat_model.keras')
|
| 9 |
|
| 10 |
classes = ["Abyssinian", "Bengal", "Bombay", "British Shorthair", "Domestic",
|
| 11 |
"Maine Coon", "Persian", "Ragdoll", "Siamese", "Sphynx"]
|
| 12 |
|
|
|
|
| 13 |
@spaces.GPU
|
| 14 |
def predict_cat(image):
|
| 15 |
if image is None:
|