yuragoithf commited on
Commit
0823229
·
verified ·
1 Parent(s): 1d000d6

Update app.py

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