Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -50,11 +50,12 @@ 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 |
-
|
54 |
-
if not os.path.isfile('model.h5'):
|
55 |
-
|
56 |
-
|
57 |
-
model = tf.keras.models.load_model('model.h5', compile=False)
|
|
|
58 |
# def load_model():
|
59 |
# # Load the model architecture
|
60 |
# with open('model.json', 'r') as f:
|
|
|
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 |
+
model = 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:
|