Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,18 @@
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
-
from PIL import Image
|
4 |
from tensorflow.keras.models import load_model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
|
7 |
try:
|
8 |
model = load_model(model_path)
|
|
|
9 |
except OSError as e:
|
10 |
print("Error loading model:", e)
|
11 |
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
|
|
3 |
from tensorflow.keras.models import load_model
|
4 |
+
from huggingface_hub import hf_hub_download
|
5 |
+
from PIL import Image
|
6 |
+
|
7 |
+
repo_id = "KevinJuanCarlos23/VehicleClassification"
|
8 |
+
filename = "vehicle_classification_model.keras"
|
9 |
+
|
10 |
+
model_path = hf_hub_download(repo_id=repo_id, filename=filename)
|
11 |
|
12 |
+
# Load model
|
13 |
try:
|
14 |
model = load_model(model_path)
|
15 |
+
print("Model loaded successfully!")
|
16 |
except OSError as e:
|
17 |
print("Error loading model:", e)
|
18 |
|