mirror of
https://github.com/wiltodelta/remove-ai-watermarks.git
synced 2026-06-05 10:38:00 +02:00
Fix macOS SSL cert issue, add troubleshooting and upgrade docs
- Add SSL certificate auto-fix in FaceProtector (certifi) - Add Troubleshooting section to README (SSL, first-run downloads) - Add upgrade instructions for pipx/uv tool users
This commit is contained in:
@@ -27,6 +27,8 @@ class FaceProtector:
|
||||
self.haar_cascade = None
|
||||
|
||||
if self.use_yolo:
|
||||
# Fix SSL certificate issues on macOS (fresh Python installs)
|
||||
self._fix_ssl_certs()
|
||||
logger.info(f"Loading YOLO model '{model_name}' for face protection...")
|
||||
self.detector = YOLO(model_name)
|
||||
else:
|
||||
@@ -71,6 +73,20 @@ class FaceProtector:
|
||||
bboxes.append((x1, y1, x2, y2))
|
||||
return bboxes
|
||||
|
||||
@staticmethod
|
||||
def _fix_ssl_certs() -> None:
|
||||
"""Set SSL_CERT_FILE from certifi if not already set (macOS fix)."""
|
||||
import os
|
||||
|
||||
if os.environ.get("SSL_CERT_FILE"):
|
||||
return
|
||||
try:
|
||||
import certifi
|
||||
|
||||
os.environ["SSL_CERT_FILE"] = certifi.where()
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
def extract_faces(self, image: np.ndarray) -> list[tuple[tuple[int, int, int, int], np.ndarray]]:
|
||||
"""
|
||||
Extract faces from the image.
|
||||
|
||||
Reference in New Issue
Block a user