Spaces:
Sleeping
Sleeping
AI-RESEARCHER-2024
commited on
Commit
•
7d05b33
1
Parent(s):
96ff654
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,6 @@ from tensorflow.keras.models import load_model
|
|
8 |
from PIL import Image, ImageDraw, ImageFont
|
9 |
from ultralytics import YOLO
|
10 |
import cv2
|
11 |
-
from huggingface_hub import from_pretrained_keras
|
12 |
|
13 |
class Config:
|
14 |
ASSETS_DIR = './assets'
|
@@ -30,10 +29,7 @@ class ModelManager:
|
|
30 |
def load_model(model_name: str):
|
31 |
model_path = os.path.join(Config.MODELS_DIR, Config.MODELS[model_name])
|
32 |
if model_name == "Dental X-Ray Segmentation":
|
33 |
-
|
34 |
-
return from_pretrained_keras("SerdarHelli/Segmentation-of-Teeth-in-Panoramic-X-ray-Image-Using-U-Net")
|
35 |
-
except:
|
36 |
-
return tf.keras.models.load_model(model_path)
|
37 |
elif model_name == "Caries Detection":
|
38 |
return YOLO(model_path)
|
39 |
else:
|
|
|
8 |
from PIL import Image, ImageDraw, ImageFont
|
9 |
from ultralytics import YOLO
|
10 |
import cv2
|
|
|
11 |
|
12 |
class Config:
|
13 |
ASSETS_DIR = './assets'
|
|
|
29 |
def load_model(model_name: str):
|
30 |
model_path = os.path.join(Config.MODELS_DIR, Config.MODELS[model_name])
|
31 |
if model_name == "Dental X-Ray Segmentation":
|
32 |
+
return load_model(model_path)
|
|
|
|
|
|
|
33 |
elif model_name == "Caries Detection":
|
34 |
return YOLO(model_path)
|
35 |
else:
|