MogensR commited on
Commit
6feefab
Β·
1 Parent(s): 15e9f21

Update ui_components.py

Browse files
Files changed (1) hide show
  1. 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
- from app import sam2_predictor, matanyone_model, models_loaded
69
 
70
- sam2_status = "βœ… Loaded & Validated" if sam2_predictor is not None else "❌ Not loaded"
71
- matanyone_status = "βœ… Loaded & Validated" if matanyone_model is not None else "❌ Not loaded"
72
- models_status = "βœ… Models Validated" if models_loaded else "❌ Not validated"
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