Update ui_components.py
Browse files- ui_components.py +6 -8
ui_components.py
CHANGED
|
@@ -13,7 +13,7 @@
|
|
| 13 |
from typing import Optional
|
| 14 |
|
| 15 |
# Import FIXED core processing functions
|
| 16 |
-
from app import load_models_with_validation, process_video_fixed
|
| 17 |
from utilities import PROFESSIONAL_BACKGROUNDS, create_procedural_background
|
| 18 |
|
| 19 |
logger = logging.getLogger(__name__)
|
|
@@ -63,17 +63,15 @@ def switch_background_method(method):
|
|
| 63 |
)
|
| 64 |
|
| 65 |
def update_cache_status():
|
| 66 |
-
"""Update cache status display with actual model state"""
|
| 67 |
try:
|
| 68 |
-
|
| 69 |
|
| 70 |
-
sam2_status = "β
Loaded & Validated" if
|
| 71 |
-
matanyone_status = "β
Loaded & Validated" if
|
| 72 |
-
models_status = "β
Models Validated" if
|
| 73 |
|
| 74 |
return f"SAM2: {sam2_status}\nMatAnyone: {matanyone_status}\nStatus: {models_status}"
|
| 75 |
-
except ImportError as e:
|
| 76 |
-
return f"Import error: {str(e)}"
|
| 77 |
except Exception as e:
|
| 78 |
return f"Status check error: {str(e)}"
|
| 79 |
|
|
|
|
| 13 |
from typing import Optional
|
| 14 |
|
| 15 |
# Import FIXED core processing functions
|
| 16 |
+
from app import load_models_with_validation, process_video_fixed, get_model_status
|
| 17 |
from utilities import PROFESSIONAL_BACKGROUNDS, create_procedural_background
|
| 18 |
|
| 19 |
logger = logging.getLogger(__name__)
|
|
|
|
| 63 |
)
|
| 64 |
|
| 65 |
def update_cache_status():
|
| 66 |
+
"""Update cache status display with actual model state - FIXED"""
|
| 67 |
try:
|
| 68 |
+
status = get_model_status()
|
| 69 |
|
| 70 |
+
sam2_status = f"β
Loaded & Validated" if status['sam2'] == 'Ready' else "β Not loaded"
|
| 71 |
+
matanyone_status = f"β
Loaded & Validated" if status['matanyone'] == 'Ready' else "β Not loaded"
|
| 72 |
+
models_status = "β
Models Validated" if status['validated'] else "β Not validated"
|
| 73 |
|
| 74 |
return f"SAM2: {sam2_status}\nMatAnyone: {matanyone_status}\nStatus: {models_status}"
|
|
|
|
|
|
|
| 75 |
except Exception as e:
|
| 76 |
return f"Status check error: {str(e)}"
|
| 77 |
|