(self)
| 10690 | return _load_tg_session() |
| 10691 | |
| 10692 | def _face_init_engine(self): |
| 10693 | if self._face_engine is not None: |
| 10694 | return self._face_engine |
| 10695 | try: |
| 10696 | # Import dinamico per evitare warning Pylance quando insightface |
| 10697 | # non e' installato nell'interprete usato dall'IDE. |
| 10698 | FaceAnalysis = importlib.import_module("insightface.app").FaceAnalysis |
| 10699 | app = FaceAnalysis(name="buffalo_l", providers=["CPUExecutionProvider"]) |
| 10700 | app.prepare(ctx_id=0, det_size=(640, 640)) |
| 10701 | self._face_engine = app |
| 10702 | return app |
| 10703 | except Exception: |
| 10704 | self._face_engine = None |
| 10705 | return None |
| 10706 | |
| 10707 | def _decode_dataurl_to_bgr(self, data_url): |
| 10708 | import numpy as np |
no outgoing calls
no test coverage detected