sowbaranika13 commited on
Commit
8f9b9e2
1 Parent(s): b8acee9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import gradio as gr
2
  import tensorflow as tf
3
  from tensorflow.keras.models import load_model
 
4
  from tensorflow.keras.preprocessing.image import img_to_array,load_img
5
  import numpy as np
6
  from PIL import Image
@@ -17,7 +18,7 @@ labels = {
17
 
18
  def preprocess_image(image):
19
  img = image.resize((224, 224)) # MobileNet requires 224x224 input size
20
- img_array = image.img_to_array(img)
21
  img_array = np.expand_dims(img_array, axis=0) # Add batch dimension
22
  img_array = preprocess_input(img_array) # Preprocess the image
23
 
 
1
  import gradio as gr
2
  import tensorflow as tf
3
  from tensorflow.keras.models import load_model
4
+
5
  from tensorflow.keras.preprocessing.image import img_to_array,load_img
6
  import numpy as np
7
  from PIL import Image
 
18
 
19
  def preprocess_image(image):
20
  img = image.resize((224, 224)) # MobileNet requires 224x224 input size
21
+ img_array = img_to_array(img)
22
  img_array = np.expand_dims(img_array, axis=0) # Add batch dimension
23
  img_array = preprocess_input(img_array) # Preprocess the image
24