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