fix: pin torch cu126 for GPU compatibility and fix cross-platform bugs

- Pin torch==2.6.0+cu126 and torchvision==0.21.0+cu126 in feature
  manifest to prevent NCCL symbol mismatch on CUDA 12.6 base images
- Move lpips after torch in install order to prevent wrong version
  resolution from PyPI
- Add einops to upscale-enhance common deps (required by SCUNet)
- Update cpu_fallback_packages to handle multi-package CUDA torch
  entries on amd64 without GPU
- Fix gpu.py ONNX CUDA detection: replace hardcoded .so path with
  cross-platform session smoke-test
- Fix os.dup(1) crashes on Windows in upscale, enhance_faces, and
  noise_removal by wrapping in try/except with sys.stderr fallback
- Guard top-level numpy/cv2 imports in colorize.py and restore.py
  with helpful error messages
- Add weights_only=False fallback for torch.load in noise_removal
- Fix integration tests to accept 501 for uninstalled AI features
  and 422 for missing system tools (exiftool, libheif)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ashim
2026-04-20 15:17:08 +08:00
co-authored by Claude Opus 4.6
parent ac5fdfb841
commit 01d30cfb61
10 changed files with 209 additions and 195 deletions
+8 -3
View File
@@ -10,9 +10,14 @@ Multi-step pipeline for restoring old and damaged photos:
import sys
import json
import os
import numpy as np
import cv2
from PIL import Image
try:
import numpy as np
import cv2
from PIL import Image
except ImportError as _e:
print(json.dumps({"error": f"Missing dependency: {_e}. Install opencv-python-headless, numpy, and Pillow."}))
sys.exit(1)
def emit_progress(percent, stage):