INNER CODE UNIT · Python

_restart_reason

yihong1120/Construction-Hazard-Detection · main.py:683

    def _restart_reason(
        proc_info: dict[str, Any],
        cfg: StreamConfig,
    ) -> str:
        """Build a compact restart reason for logs."""
        if cfg['updated_at'] != proc_info['updated_at']:
            return 'updated_at changed'
        if not proc_info['process'].is_alive():
            return 'process exited'
        return 'YOLO worker restarted'

    def _yolo_worker_slot(
        self,
        cfg: StreamConfig,
    ) -> tuple[object | None, object | None]:
        """Return the worker and dedicated result queue assigned to a camera.

        Sharded mode pins up to the configured number of same-model cameras to

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…