Sa-m commited on
Commit
06ee487
·
1 Parent(s): c73e8b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -30,6 +30,8 @@ model=load_model('best_model.h5')
30
 
31
  def classify_image(inp):
32
  np.random.seed(143)
 
 
33
  inp = inp.reshape((-1, HEIGHT, WIDTH, 3))
34
  inp = tf.keras.applications.nasnet.preprocess_input(inp)
35
  prediction = model.predict(inp)
@@ -42,7 +44,7 @@ def classify_image(inp):
42
  result[label] = float(predicted_class_indices[i])
43
  except KeyError:
44
  print(f"KeyError: Label not found for index {predicted_class_indices[i]}")
45
- return prediction
46
 
47
 
48
 
 
30
 
31
  def classify_image(inp):
32
  np.random.seed(143)
33
+ labels = {'Burger King': 0, 'KFC': 1, 'McDonalds': 2, 'Other': 3, 'Starbucks': 4, 'Subway': 5}
34
+ NUM_CLASSES = 6
35
  inp = inp.reshape((-1, HEIGHT, WIDTH, 3))
36
  inp = tf.keras.applications.nasnet.preprocess_input(inp)
37
  prediction = model.predict(inp)
 
44
  result[label] = float(predicted_class_indices[i])
45
  except KeyError:
46
  print(f"KeyError: Label not found for index {predicted_class_indices[i]}")
47
+ return result
48
 
49
 
50