Spaces:
Runtime error
Runtime error
noorulain17
commited on
Commit
·
fccfe6f
1
Parent(s):
0a16e6f
Update app.py
Browse files
app.py
CHANGED
@@ -14,13 +14,13 @@ from PIL import Image
|
|
14 |
import gradio as gr
|
15 |
|
16 |
# Load your trained model
|
17 |
-
model = tf.keras.models.load_model('
|
18 |
|
19 |
# Define the image size
|
20 |
IMG_SIZE = 224
|
21 |
|
22 |
# Load class names from the text file
|
23 |
-
with open('
|
24 |
class_names = [line.strip() for line in file]
|
25 |
|
26 |
# Define a function to preprocess the image
|
|
|
14 |
import gradio as gr
|
15 |
|
16 |
# Load your trained model
|
17 |
+
model = tf.keras.models.load_model('model.h5', custom_objects={'KerasLayer': hub.KerasLayer})
|
18 |
|
19 |
# Define the image size
|
20 |
IMG_SIZE = 224
|
21 |
|
22 |
# Load class names from the text file
|
23 |
+
with open('class_names.txt', 'r') as file:
|
24 |
class_names = [line.strip() for line in file]
|
25 |
|
26 |
# Define a function to preprocess the image
|