mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix(ai): use .tflite URL for blaze_face_short_range model
Google removed the .task bundle from their MediaPipe storage, causing Docker builds to fail with a 404 during model download.
This commit is contained in:
@@ -66,8 +66,8 @@ NAFNET_MODEL_PATH = os.path.join(NAFNET_MODEL_DIR, "NAFNet-SIDD-width64.pth")
|
|||||||
NAFNET_MIN_SIZE = 60_000_000 # ~67 MB
|
NAFNET_MIN_SIZE = 60_000_000 # ~67 MB
|
||||||
|
|
||||||
MEDIAPIPE_MODEL_DIR = "/opt/models/mediapipe"
|
MEDIAPIPE_MODEL_DIR = "/opt/models/mediapipe"
|
||||||
FACE_DETECT_MODEL_URL = "https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/latest/blaze_face_short_range.task"
|
FACE_DETECT_MODEL_URL = "https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/latest/blaze_face_short_range.tflite"
|
||||||
FACE_DETECT_MODEL_PATH = os.path.join(MEDIAPIPE_MODEL_DIR, "blaze_face_short_range.task")
|
FACE_DETECT_MODEL_PATH = os.path.join(MEDIAPIPE_MODEL_DIR, "blaze_face_short_range.tflite")
|
||||||
FACE_DETECT_MIN_SIZE = 100_000 # ~200 KB
|
FACE_DETECT_MIN_SIZE = 100_000 # ~200 KB
|
||||||
FACE_LANDMARKER_MODEL_URL = "https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/latest/face_landmarker.task"
|
FACE_LANDMARKER_MODEL_URL = "https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/latest/face_landmarker.task"
|
||||||
FACE_LANDMARKER_MODEL_PATH = os.path.join(MEDIAPIPE_MODEL_DIR, "face_landmarker.task")
|
FACE_LANDMARKER_MODEL_PATH = os.path.join(MEDIAPIPE_MODEL_DIR, "face_landmarker.task")
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ def emit_progress(percent, stage):
|
|||||||
|
|
||||||
# ── Model path for new mp.tasks API ─────────────────────────────────
|
# ── Model path for new mp.tasks API ─────────────────────────────────
|
||||||
|
|
||||||
_FACE_DETECT_MODEL_URL = "https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/latest/blaze_face_short_range.task"
|
_FACE_DETECT_MODEL_URL = "https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/latest/blaze_face_short_range.tflite"
|
||||||
_DOCKER_MODEL_PATH = "/opt/models/mediapipe/blaze_face_short_range.task"
|
_DOCKER_MODEL_PATH = "/opt/models/mediapipe/blaze_face_short_range.tflite"
|
||||||
_LOCAL_MODEL_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "..", ".models")
|
_LOCAL_MODEL_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "..", ".models")
|
||||||
_LOCAL_MODEL_PATH = os.path.join(_LOCAL_MODEL_DIR, "blaze_face_short_range.task")
|
_LOCAL_MODEL_PATH = os.path.join(_LOCAL_MODEL_DIR, "blaze_face_short_range.tflite")
|
||||||
|
|
||||||
|
|
||||||
def _ensure_face_detect_model():
|
def _ensure_face_detect_model():
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ CODEFORMER_MODEL_PATH = os.environ.get(
|
|||||||
|
|
||||||
# ── Model path for new mp.tasks API ─────────────────────────────────
|
# ── Model path for new mp.tasks API ─────────────────────────────────
|
||||||
|
|
||||||
_FACE_DETECT_MODEL_URL = "https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/latest/blaze_face_short_range.task"
|
_FACE_DETECT_MODEL_URL = "https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/latest/blaze_face_short_range.tflite"
|
||||||
_DOCKER_MODEL_PATH = "/opt/models/mediapipe/blaze_face_short_range.task"
|
_DOCKER_MODEL_PATH = "/opt/models/mediapipe/blaze_face_short_range.tflite"
|
||||||
_LOCAL_MODEL_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "..", ".models")
|
_LOCAL_MODEL_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "..", ".models")
|
||||||
_LOCAL_MODEL_PATH = os.path.join(_LOCAL_MODEL_DIR, "blaze_face_short_range.task")
|
_LOCAL_MODEL_PATH = os.path.join(_LOCAL_MODEL_DIR, "blaze_face_short_range.tflite")
|
||||||
|
|
||||||
|
|
||||||
def _ensure_face_detect_model():
|
def _ensure_face_detect_model():
|
||||||
|
|||||||
@@ -219,10 +219,10 @@ def _get_codeformer_path():
|
|||||||
|
|
||||||
# ── Model path for new mp.tasks API ─────────────────────────────────
|
# ── Model path for new mp.tasks API ─────────────────────────────────
|
||||||
|
|
||||||
_FACE_DETECT_MODEL_URL = "https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/latest/blaze_face_short_range.task"
|
_FACE_DETECT_MODEL_URL = "https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/latest/blaze_face_short_range.tflite"
|
||||||
_FACE_DETECT_DOCKER_PATH = "/opt/models/mediapipe/blaze_face_short_range.task"
|
_FACE_DETECT_DOCKER_PATH = "/opt/models/mediapipe/blaze_face_short_range.tflite"
|
||||||
_FACE_DETECT_LOCAL_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "..", ".models")
|
_FACE_DETECT_LOCAL_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "..", ".models")
|
||||||
_FACE_DETECT_LOCAL_PATH = os.path.join(_FACE_DETECT_LOCAL_DIR, "blaze_face_short_range.task")
|
_FACE_DETECT_LOCAL_PATH = os.path.join(_FACE_DETECT_LOCAL_DIR, "blaze_face_short_range.tflite")
|
||||||
|
|
||||||
|
|
||||||
def _ensure_face_detect_model():
|
def _ensure_face_detect_model():
|
||||||
|
|||||||
Reference in New Issue
Block a user