Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,14 +3,13 @@ from PIL import Image
|
|
3 |
import numpy as np
|
4 |
import gradio as gr
|
5 |
from tensorflow import keras
|
6 |
-
|
7 |
-
# Load the model (replace with the correct path on Hugging Face Spaces)
|
8 |
-
import tensorflow as tf
|
9 |
|
10 |
model_path = "VGG_16.h5"
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
14 |
|
15 |
# Define the class labels
|
16 |
class_labels = ['biotite', 'granite', 'olivine', 'plagioclase', 'staurolite']
|
|
|
3 |
import numpy as np
|
4 |
import gradio as gr
|
5 |
from tensorflow import keras
|
6 |
+
from keras.models import load_model
|
|
|
|
|
7 |
|
8 |
model_path = "VGG_16.h5"
|
9 |
+
model = load_model(model_path, compile=False)
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
|
14 |
# Define the class labels
|
15 |
class_labels = ['biotite', 'granite', 'olivine', 'plagioclase', 'staurolite']
|