fix: audit fixes for cross-platform correctness

- Fix NameError in restore.py: face enhancement loop used undefined
  variable `i`, now uses enumerate()
- Fix gpu.py ONNX fallback: previous smoke-test with empty bytes
  always raised, making GPU detection unreachable via the ONNX path.
  Now uses nvidia-smi hardware check after confirming CUDA EP is
  compiled in — works on Linux, Windows, and gracefully fails on macOS
- Fix cpu_fallback_packages stripping CUDA-specific index URLs when
  replacing paddlepaddle-gpu with paddlepaddle for CPU-only systems

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ashim
2026-04-20 15:28:35 +08:00
co-authored by Claude Opus 4.6
parent 01d30cfb61
commit 39e27635c8
3 changed files with 20 additions and 23 deletions
+1 -1
View File
@@ -331,7 +331,7 @@ def enhance_faces(img_bgr, fidelity=0.7):
result = img_bgr.copy()
faces_enhanced = 0
for face_box in face_boxes:
for i, face_box in enumerate(face_boxes):
x = face_box["x"]
y = face_box["y"]
w = face_box["w"]