KaburaJ commited on
Commit
4fa426b
·
1 Parent(s): d25500f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -14
app.py CHANGED
@@ -50,21 +50,22 @@ set_png_as_page_bg('background.webp')
50
  # #CNN_class_index = json.load(open(f"{os.getcwd()}F:\Machine Learning Resources\ZebraHorse\model.json"))
51
  # return model, CNN_class_index
52
 
53
- def load_model():
54
- if not os.path.isfile('model.h5'):
55
- subprocess.run(['curl --output model.h5 "https://github.com/KaburaJ/Binary-Image-classification/blob/main/ZebraHorse/CNN%20Application/model.h5"'], shell=True)
56
-
57
- tf.keras.models.load_model('model.h5', compile=False)
58
- return model
59
  # def load_model():
60
- # # Load the model architecture
61
- # with open('model.json', 'r') as f:
62
- # model = model_from_json(f.read())
63
-
64
- # # Load the model weights
65
- # model.load_weights('model.h5')
66
- # #CNN_class_index = json.load(open(f"{os.getcwd()}F:\Machine Learning Resources\ZebraHorse\model.json"))
67
- # return model
 
 
 
 
 
 
 
68
 
69
 
70
  def image_transformation(image):
 
50
  # #CNN_class_index = json.load(open(f"{os.getcwd()}F:\Machine Learning Resources\ZebraHorse\model.json"))
51
  # return model, CNN_class_index
52
 
 
 
 
 
 
 
53
  # def load_model():
54
+ # if not os.path.isfile('model.h5'):
55
+ # subprocess.run(['curl --output model.h5 "https://github.com/KaburaJ/Binary-Image-classification/blob/main/ZebraHorse/CNN%20Application/model.h5"'], shell=True)
56
+
57
+ # tf.keras.models.load_model('model.h5', compile=False)
58
+ # return model
59
+
60
+ def load_model():
61
+ # Load the model architecture
62
+ with open('model.json', 'r') as f:
63
+ model_from_json(f.read())
64
+
65
+ # Load the model weights
66
+ model.load_weights('model.h5')
67
+ #CNN_class_index = json.load(open(f"{os.getcwd()}F:\Machine Learning Resources\ZebraHorse\model.json"))
68
+ return model
69
 
70
 
71
  def image_transformation(image):