yuragoithf commited on
Commit
5ff014d
·
verified ·
1 Parent(s): 81ace21

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import gradio as gr
2
- # import tensorflow as tf
3
  import os
4
  import keras
5
  import gdown
@@ -22,21 +22,18 @@ labels = {
22
  9: "truck",
23
  }
24
 
25
- full_path = ""
26
  # Download the model file
27
  def download_model():
28
- url = "https://drive.google.com/uc?id=12700bE-pomYKoVQ214VrpBoJ7akXcTpL"
 
29
  output = "modelV2Lmixed.keras"
30
  gdown.download(url, output, quiet=False)
31
- full_path = os.path.abspath(output)
32
- #return output
33
- return full_path
34
 
35
- #model_file = download_model()
36
- download_model()
37
 
38
  # Load the model
39
- model = keras.saving.load_model(full_path)
40
 
41
  # Perform image classification for single class output
42
  # def predict_class(image):
 
1
  import gradio as gr
2
+ import tensorflow as tf
3
  import os
4
  import keras
5
  import gdown
 
22
  9: "truck",
23
  }
24
 
 
25
  # Download the model file
26
  def download_model():
27
+ #url = "https://drive.google.com/uc?id=12700bE-pomYKoVQ214VrpBoJ7akXcTpL"
28
+ url = "https://drive.google.com/uc?id=1fclkgIgUo26g014beN8UhCJ2TfvGG2sG"
29
  output = "modelV2Lmixed.keras"
30
  gdown.download(url, output, quiet=False)
31
+ return output
 
 
32
 
33
+ model_file = download_model()
 
34
 
35
  # Load the model
36
+ model = tf.keras.models.load_model(model_file)
37
 
38
  # Perform image classification for single class output
39
  # def predict_class(image):