Rishav-ctrl commited on
Commit
fbfac5c
·
verified ·
1 Parent(s): 9d7fc97

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1,10 +1,10 @@
1
  import gradio as gr
2
- from tensorflow.keras.models import load_model
3
  from tensorflow.keras.preprocessing import image
4
  import numpy as np
5
 
6
- # Load your trained model
7
- model = load_model("waste_sort_model.h5")
8
  class_names = ["Non-Recyclable", "Recyclable"]
9
 
10
  def classify_image(img):
@@ -29,3 +29,4 @@ interface = gr.Interface(
29
  # Launch the Gradio app
30
  if __name__ == "__main__":
31
  interface.launch()
 
 
1
  import gradio as gr
2
+ import tensorflow as tf
3
  from tensorflow.keras.preprocessing import image
4
  import numpy as np
5
 
6
+ # Load your trained model (SavedModel format)
7
+ model = tf.keras.models.load_model("waste_sort_model") # Loading from SavedModel directory
8
  class_names = ["Non-Recyclable", "Recyclable"]
9
 
10
  def classify_image(img):
 
29
  # Launch the Gradio app
30
  if __name__ == "__main__":
31
  interface.launch()
32
+