mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: skip RealESRGAN import check on arm64 in smoke test
basicsr has a known torchvision.transforms.functional_tensor compat issue on arm64 with newer torchvision. On arm64, upscale.py falls back to Lanczos via ImportError anyway. Smoke test still verifies the model weights file exists on all platforms.
This commit is contained in:
@@ -85,17 +85,28 @@ def verify_mediapipe():
|
|||||||
|
|
||||||
def smoke_test():
|
def smoke_test():
|
||||||
"""Final verification that all ML libraries and models are loadable."""
|
"""Final verification that all ML libraries and models are loadable."""
|
||||||
|
import platform
|
||||||
|
|
||||||
print("=== Running smoke test ===")
|
print("=== Running smoke test ===")
|
||||||
|
is_amd64 = platform.machine() in ("x86_64", "amd64")
|
||||||
|
|
||||||
from rembg import new_session
|
from rembg import new_session
|
||||||
from realesrgan import RealESRGANer
|
|
||||||
from basicsr.archs.rrdbnet_arch import RRDBNet
|
|
||||||
from paddleocr import PaddleOCR
|
from paddleocr import PaddleOCR
|
||||||
import mediapipe as mp
|
import mediapipe as mp
|
||||||
import cv2
|
import cv2
|
||||||
import numpy
|
import numpy
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
import seam_carving
|
import seam_carving
|
||||||
|
print(" Core imports OK")
|
||||||
|
|
||||||
|
# RealESRGAN/basicsr has a known torchvision compat issue on arm64.
|
||||||
|
# On amd64 we verify the full import chain; on arm64 we just check the model file.
|
||||||
|
if is_amd64:
|
||||||
|
from realesrgan import RealESRGANer
|
||||||
|
from basicsr.archs.rrdbnet_arch import RRDBNet
|
||||||
|
print(" RealESRGAN imports OK (amd64)")
|
||||||
|
else:
|
||||||
|
print(" RealESRGAN import skipped (arm64 - Lanczos fallback used)")
|
||||||
|
|
||||||
assert os.path.exists(REALESRGAN_MODEL_PATH), (
|
assert os.path.exists(REALESRGAN_MODEL_PATH), (
|
||||||
f"RealESRGAN model missing: {REALESRGAN_MODEL_PATH}"
|
f"RealESRGAN model missing: {REALESRGAN_MODEL_PATH}"
|
||||||
@@ -104,7 +115,6 @@ def smoke_test():
|
|||||||
"RealESRGAN model file is too small"
|
"RealESRGAN model file is too small"
|
||||||
)
|
)
|
||||||
|
|
||||||
print(" All imports OK")
|
|
||||||
print(" RealESRGAN model file verified")
|
print(" RealESRGAN model file verified")
|
||||||
print("Smoke test passed.\n")
|
print("Smoke test passed.\n")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user