# Python Agent Context ## Environment - **Directory**: `/workspaces/zed-playground/py_workspace` - **Package Manager**: `uv` - **Python Version**: 3.12+ (Managed by `uv`) - **Dependencies**: Defined in `pyproject.toml` - `pyzed`: ZED SDK Python wrapper - `opencv-python`: GUI and image processing - `click`: CLI argument parsing - `numpy`, `cupy-cuda12x`: Data manipulation ## Workflow & Commands - **Run Scripts**: Always use `uv run` to ensure correct environment. ```bash uv run streaming_receiver.py --help uv run recording_multi.py ``` - **New Dependencies**: Add with `uv add ` (e.g., `uv add requests`). ## Architecture & Patterns - **Network Camera Handling**: - Use `zed_network_utils.py` for all network config parsing. - Config file: `/workspaces/zed-playground/zed_settings/inside_network.json` - **Threading Model**: - **Main Thread**: MUST handle all OpenCV GUI (`cv2.imshow`, `cv2.waitKey`). - **Worker Threads**: Handle `camera.grab()` and data retrieval. - **Communication**: Use `queue.Queue` to pass frames from workers to main. - **ZED API Patterns**: - Streaming Input: `init_params.set_from_stream(ip, port)` - Serial Number: Use `camera.get_camera_information().serial_number`. ## Documentation & References - **Python API Docs**: `/usr/local/zed/doc/API/html/python/index.html` - **ZED SDK General Docs**: `/usr/local/zed/doc/` - **C++ Headers (Reference)**: `/usr/local/zed/include/sl/` - Useful for understanding underlying enum values or behaviors not fully detailed in Python docstrings.