coderuday21 commited on
Commit
3e1a5d9
·
1 Parent(s): aa4d14b

Fix: rename models/ to cd_models/ to avoid shadowing app/models.py (SQLAlchemy User model)

Browse files
Dockerfile CHANGED
@@ -19,7 +19,7 @@ WORKDIR /app
19
 
20
  # Build-time info + cache-bust:
21
  # Changing APP_BUILD forces Docker to re-run subsequent layers (including pip install).
22
- ARG APP_BUILD=19
23
  ENV APP_BUILD=${APP_BUILD}
24
  RUN echo "Docker build start: APP_BUILD=${APP_BUILD}" && python -V
25
 
 
19
 
20
  # Build-time info + cache-bust:
21
  # Changing APP_BUILD forces Docker to re-run subsequent layers (including pip install).
22
+ ARG APP_BUILD=20
23
  ENV APP_BUILD=${APP_BUILD}
24
  RUN echo "Docker build start: APP_BUILD=${APP_BUILD}" && python -V
25
 
app/{models → cd_models}/__init__.py RENAMED
File without changes
app/{models → cd_models}/change_model.py RENAMED
File without changes
app/{models → cd_models}/model_utils.py RENAMED
File without changes
app/detection_engine.py CHANGED
@@ -829,7 +829,7 @@ def _build_confidence_map_from_channels(img1, img2, dl_score=None):
829
  Includes color, SSIM, texture, edge, CVA, and optionally a DL score map.
830
  Returns float32 map in [0,1].
831
  """
832
- from .models.model_utils import build_confidence_map
833
 
834
  color = compute_cva(img1, img2)
835
  ssim = compute_ssim_change_map(img1, img2)
@@ -853,7 +853,7 @@ def _build_confidence_map_from_channels(img1, img2, dl_score=None):
853
 
854
  def _multiscale_classical(img1, img2, sensitivity=0.5):
855
  """Run classical fusion at multiple scales and OR-combine for better recall."""
856
- from .models.model_utils import multiscale_detect
857
 
858
  def _single_scale_detect(s1, s2):
859
  mask, _ = _ai_fusion_core(s1, s2, sensitivity=sensitivity)
@@ -892,7 +892,7 @@ def hybrid_ai_method(img1, img2, sensitivity=0.5):
892
 
893
  if dl_method == "none":
894
  try:
895
- from .models.change_model import is_siamese_available, predict_siamese
896
  if is_siamese_available():
897
  dl_mask, dl_score = predict_siamese(img1, img2, threshold=thr)
898
  dl_method = "siamese_unet"
 
829
  Includes color, SSIM, texture, edge, CVA, and optionally a DL score map.
830
  Returns float32 map in [0,1].
831
  """
832
+ from .cd_models.model_utils import build_confidence_map
833
 
834
  color = compute_cva(img1, img2)
835
  ssim = compute_ssim_change_map(img1, img2)
 
853
 
854
  def _multiscale_classical(img1, img2, sensitivity=0.5):
855
  """Run classical fusion at multiple scales and OR-combine for better recall."""
856
+ from .cd_models.model_utils import multiscale_detect
857
 
858
  def _single_scale_detect(s1, s2):
859
  mask, _ = _ai_fusion_core(s1, s2, sensitivity=sensitivity)
 
892
 
893
  if dl_method == "none":
894
  try:
895
+ from .cd_models.change_model import is_siamese_available, predict_siamese
896
  if is_siamese_available():
897
  dl_mask, dl_score = predict_siamese(img1, img2, threshold=thr)
898
  dl_method = "siamese_unet"