Sa-m commited on
Commit
a1507f1
1 Parent(s): 0764d7b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -10,14 +10,15 @@ from tensorflow.keras.applications.inception_resnet_v2 import InceptionResNetV2
10
  #os.environ['TF_ENABLE_ONEDNN_OPTS']='0'
11
  model=load_model('best_model_76.h5')
12
 
 
13
  def classify_image(inp):
14
- inp = inp.reshape((-1, IMG_SIZE, IMG_SIZE, 3))
15
- #inp = tf.keras.applications.vgg16.preprocess_input(inp)
16
  prediction = model.predict(inp).flatten()
17
  return {labels[i]: float(prediction[i]) for i in range(NUM_CLASSES)}
18
 
19
- image = gr.inputs.Image(shape=(IMG_SIZE, IMG_SIZE),label='Input')
20
- label = gr.outputs.Label(num_top_classes=2)
21
 
22
  gr.Interface(fn=classify_image, inputs=image, outputs=label, title='Brand Logo Detection').launch(debug=False)
23
 
 
10
  #os.environ['TF_ENABLE_ONEDNN_OPTS']='0'
11
  model=load_model('best_model_76.h5')
12
 
13
+
14
  def classify_image(inp):
15
+ inp = inp.reshape((-1, HEIGHT,WIDTH, 3))
16
+ inp = tf.keras.applications.nasnet.preprocess_input(inp)
17
  prediction = model.predict(inp).flatten()
18
  return {labels[i]: float(prediction[i]) for i in range(NUM_CLASSES)}
19
 
20
+ image = gr.Image(shape=(HEIGHT,WIDTH),label='Input')
21
+ label = gr.Label()
22
 
23
  gr.Interface(fn=classify_image, inputs=image, outputs=label, title='Brand Logo Detection').launch(debug=False)
24