xcurvnubaim commited on
Commit
9478d60
·
1 Parent(s): fb34fd5

fix: fix dependencies

Browse files
Files changed (2) hide show
  1. app.py +3 -5
  2. requirements.txt +11 -5
app.py CHANGED
@@ -1,4 +1,3 @@
1
- from tensorflow.keras.models import load_model
2
  import numpy as np
3
  import gradio as gr
4
  import tensorflow as tf
@@ -6,8 +5,8 @@ from io import StringIO
6
  from PIL import Image
7
 
8
  labels = []
9
- model = load_model('models.h5')
10
- with open("name of the animals.txt") as f:
11
  for line in f:
12
  labels.append(line.replace('\n', ''))
13
 
@@ -26,5 +25,4 @@ def classify_image(inp):
26
 
27
  demo = gr.Interface(classify_image, gr.Image(), gr.Label(num_top_classes=3))
28
  if __name__ == "__main__":
29
- demo.launch()
30
-
 
 
1
  import numpy as np
2
  import gradio as gr
3
  import tensorflow as tf
 
5
  from PIL import Image
6
 
7
  labels = []
8
+ model = tf.keras.models.load_model('./models.h5')
9
+ with open("labels.txt") as f:
10
  for line in f:
11
  labels.append(line.replace('\n', ''))
12
 
 
25
 
26
  demo = gr.Interface(classify_image, gr.Image(), gr.Label(num_top_classes=3))
27
  if __name__ == "__main__":
28
+ demo.launch()
 
requirements.txt CHANGED
@@ -1,6 +1,12 @@
1
- gradio
2
- numpy
3
- Pillow
4
- requests
5
  tensorflow
6
- keras
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  tensorflow
2
+ tensorflow-estimator==2.15.0
3
+ tensorflow-gcs-config==2.15.0
4
+ tensorflow-hub==0.16.1
5
+ tensorflow-io-gcs-filesystem==0.36.0
6
+ tensorflow-metadata==1.15.0
7
+ tensorflow-probability==0.23.0
8
+ gradio==4.28.3
9
+ gradio_client==0.16.0
10
+ numpy==1.25.2
11
+ Pillow==9.4.0
12
+ keras==2.15.0