Mr-Vicky-01 commited on
Commit
9062971
1 Parent(s): 977eabe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -8,7 +8,10 @@ labels = ['american_football', 'baseball', 'basketball', 'billiard_ball', 'bowli
8
  'table_tennis_ball', 'tennis_ball', 'volleyball']
9
 
10
  def predict_image(inp):
11
- img = tf.image.resize(inp, (224, 224))
 
 
 
12
  img = tf.keras.preprocessing.image.img_to_array(img)
13
  img = np.expand_dims(img, axis=0)
14
 
 
8
  'table_tennis_ball', 'tennis_ball', 'volleyball']
9
 
10
  def predict_image(inp):
11
+ if inp is not None:
12
+ img = tf.image.resize(inp, (224, 224))
13
+ else:
14
+ print("Input is None. Unable to resize.")
15
  img = tf.keras.preprocessing.image.img_to_array(img)
16
  img = np.expand_dims(img, axis=0)
17