Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ from huggingface_hub import hf_hub_download
|
|
| 3 |
import cv2
|
| 4 |
import numpy as np
|
| 5 |
import tensorflow as tf
|
|
|
|
| 6 |
import pandas as pd
|
| 7 |
import base64
|
| 8 |
import json
|
|
@@ -13,7 +14,8 @@ app = Flask(__name__)
|
|
| 13 |
# Load model and data at startup
|
| 14 |
# model = tf.keras.models.load_model("/data/app/sneaker_category_predictor_v2.h5")
|
| 15 |
model_path = hf_hub_download(repo_id="thejagstudio/SneakerAI", filename="sneaker_category_predictor_v2.h5", repo_type="model")
|
| 16 |
-
model = tf.keras.models.load_model(model_path
|
|
|
|
| 17 |
|
| 18 |
# Define expected columns for one-hot encoding
|
| 19 |
with open("metadata.json", "r") as f:
|
|
|
|
| 3 |
import cv2
|
| 4 |
import numpy as np
|
| 5 |
import tensorflow as tf
|
| 6 |
+
from keras.models import load_model
|
| 7 |
import pandas as pd
|
| 8 |
import base64
|
| 9 |
import json
|
|
|
|
| 14 |
# Load model and data at startup
|
| 15 |
# model = tf.keras.models.load_model("/data/app/sneaker_category_predictor_v2.h5")
|
| 16 |
model_path = hf_hub_download(repo_id="thejagstudio/SneakerAI", filename="sneaker_category_predictor_v2.h5", repo_type="model")
|
| 17 |
+
# model = tf.keras.models.load_model(model_path)
|
| 18 |
+
model = load_model(model_path)
|
| 19 |
|
| 20 |
# Define expected columns for one-hot encoding
|
| 21 |
with open("metadata.json", "r") as f:
|