Files
opencv-MIRROR/modules/python
Kazi Sufiyan 2603b839cb python: fix LayerId typing alias referencing missing cv2.dnn.DictValue
The generated cv2/typing/__init__.py defined LayerId as cv2.dnn.DictValue.
This line runs on every "import cv2", so if cv2.dnn.DictValue is not
available the whole import fails with AttributeError.

Net::Impl::getLayerId(DictValue&) accepts only an integer layer index or
a string layer name and asserts for anything else, so describe LayerId
as Union[int, str]. This also removes the runtime dependency on cv2.dnn
from the typing module.

Add a test that checks the generated cv2.typing.LayerId alias.
2026-11-19 08:58:07 +00:00
..