methestrikerx100 commited on
Commit
ba77679
·
verified ·
1 Parent(s): 36435cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
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
- input_shape = (224, 224, 3) # Replace with your input shape
12
- model = tf.keras.models.load_model(model_path, compile=False)
13
- model.build(input_shape)
 
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']