(self, data_url)
| 10705 | return None |
| 10706 | |
| 10707 | def _decode_dataurl_to_bgr(self, data_url): |
| 10708 | import numpy as np |
| 10709 | import cv2 |
| 10710 | if not data_url or "," not in data_url: |
| 10711 | return None |
| 10712 | raw = data_url.split(",", 1)[1] |
| 10713 | img_bytes = base64.b64decode(raw) |
| 10714 | arr = np.frombuffer(img_bytes, dtype=np.uint8) |
| 10715 | return cv2.imdecode(arr, cv2.IMREAD_COLOR) |
| 10716 | |
| 10717 | def _annotate_faces(self, bgr, faces): |
| 10718 | import cv2 |