Sa-m commited on
Commit
03c6e36
·
verified ·
1 Parent(s): 6a269e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -51
app.py CHANGED
@@ -1,54 +1,3 @@
1
- # import gradio as gr
2
- # import tensorflow as tf
3
- # import numpy as np
4
- # import os
5
-
6
- # # Configuration
7
- # HEIGHT, WIDTH = 224, 224
8
- # NUM_CLASSES = 6
9
- # LABELS = [ "McDonalds","Burger King","Subway", "Starbucks", "KFC","Other"]
10
- # from tensorflow_addons.metrics import F1Score
11
- # from keras.utils import custom_object_scope
12
-
13
- # with custom_object_scope({'Addons>F1Score': F1Score}):
14
- # model = tf.keras.models.load_model('best_model.h5')
15
-
16
-
17
- # def classify_image(inp):
18
- # np.random.seed(143)
19
-
20
- # # Ensure input is resized to expected shape
21
- # inp = tf.image.resize(inp, [HEIGHT, WIDTH])
22
- # inp = tf.cast(inp, tf.float32) # ensure correct dtype for preprocessing
23
- # inp = tf.keras.applications.nasnet.preprocess_input(inp)
24
- # inp = tf.expand_dims(inp, axis=0) # make batch dimension
25
-
26
- # # Prediction
27
- # prediction = model.predict(inp)
28
-
29
- # return {LABELS[i]: float(f"{prediction[0][i]:.6f}") for i in range(NUM_CLASSES)}
30
-
31
-
32
-
33
-
34
- # iface = gr.Interface(
35
- # fn=classify_image,
36
- # inputs=gr.Image(
37
- # label="Input Image",
38
- # source="upload",
39
- # type="numpy",
40
- # height=HEIGHT,
41
- # width=WIDTH
42
- # ),
43
- # outputs=gr.Label(num_top_classes=4),
44
- # title="Brand Logo Detection",
45
- # examples=example_list
46
- # )
47
-
48
- # if __name__ == "__main__":
49
- # iface.launch(debug=False,share=True)
50
-
51
-
52
 
53
  import gradio as gr
54
  import tensorflow as tf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
  import gradio as gr
3
  import tensorflow as tf