__init__.pyi 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. __all__: list[str] = []
  2. import cv2
  3. import cv2.typing
  4. import numpy
  5. import os
  6. import sys
  7. import typing as _typing
  8. if sys.version_info >= (3, 8):
  9. from typing import Protocol
  10. else:
  11. from typing_extensions import Protocol
  12. # Enumerations
  13. DNN_BACKEND_DEFAULT: int
  14. DNN_BACKEND_HALIDE: int
  15. DNN_BACKEND_INFERENCE_ENGINE: int
  16. DNN_BACKEND_OPENCV: int
  17. DNN_BACKEND_VKCOM: int
  18. DNN_BACKEND_CUDA: int
  19. DNN_BACKEND_WEBNN: int
  20. DNN_BACKEND_TIMVX: int
  21. DNN_BACKEND_CANN: int
  22. Backend = int
  23. """One of [DNN_BACKEND_DEFAULT, DNN_BACKEND_HALIDE, DNN_BACKEND_INFERENCE_ENGINE, DNN_BACKEND_OPENCV, DNN_BACKEND_VKCOM, DNN_BACKEND_CUDA, DNN_BACKEND_WEBNN, DNN_BACKEND_TIMVX, DNN_BACKEND_CANN]"""
  24. DNN_TARGET_CPU: int
  25. DNN_TARGET_OPENCL: int
  26. DNN_TARGET_OPENCL_FP16: int
  27. DNN_TARGET_MYRIAD: int
  28. DNN_TARGET_VULKAN: int
  29. DNN_TARGET_FPGA: int
  30. DNN_TARGET_CUDA: int
  31. DNN_TARGET_CUDA_FP16: int
  32. DNN_TARGET_HDDL: int
  33. DNN_TARGET_NPU: int
  34. DNN_TARGET_CPU_FP16: int
  35. Target = int
  36. """One of [DNN_TARGET_CPU, DNN_TARGET_OPENCL, DNN_TARGET_OPENCL_FP16, DNN_TARGET_MYRIAD, DNN_TARGET_VULKAN, DNN_TARGET_FPGA, DNN_TARGET_CUDA, DNN_TARGET_CUDA_FP16, DNN_TARGET_HDDL, DNN_TARGET_NPU, DNN_TARGET_CPU_FP16]"""
  37. DNN_LAYOUT_UNKNOWN: int
  38. DNN_LAYOUT_ND: int
  39. DNN_LAYOUT_NCHW: int
  40. DNN_LAYOUT_NCDHW: int
  41. DNN_LAYOUT_NHWC: int
  42. DNN_LAYOUT_NDHWC: int
  43. DNN_LAYOUT_PLANAR: int
  44. DataLayout = int
  45. """One of [DNN_LAYOUT_UNKNOWN, DNN_LAYOUT_ND, DNN_LAYOUT_NCHW, DNN_LAYOUT_NCDHW, DNN_LAYOUT_NHWC, DNN_LAYOUT_NDHWC, DNN_LAYOUT_PLANAR]"""
  46. DNN_PMODE_NULL: int
  47. DNN_PMODE_CROP_CENTER: int
  48. DNN_PMODE_LETTERBOX: int
  49. ImagePaddingMode = int
  50. """One of [DNN_PMODE_NULL, DNN_PMODE_CROP_CENTER, DNN_PMODE_LETTERBOX]"""
  51. SoftNMSMethod_SOFTNMS_LINEAR: int
  52. SOFT_NMSMETHOD_SOFTNMS_LINEAR: int
  53. SoftNMSMethod_SOFTNMS_GAUSSIAN: int
  54. SOFT_NMSMETHOD_SOFTNMS_GAUSSIAN: int
  55. SoftNMSMethod = int
  56. """One of [SoftNMSMethod_SOFTNMS_LINEAR, SOFT_NMSMETHOD_SOFTNMS_LINEAR, SoftNMSMethod_SOFTNMS_GAUSSIAN, SOFT_NMSMETHOD_SOFTNMS_GAUSSIAN]"""
  57. # Classes
  58. class DictValue:
  59. # Functions
  60. @_typing.overload
  61. def __init__(self, i: int) -> None: ...
  62. @_typing.overload
  63. def __init__(self, p: float) -> None: ...
  64. @_typing.overload
  65. def __init__(self, s: str) -> None: ...
  66. def isInt(self) -> bool: ...
  67. def isString(self) -> bool: ...
  68. def isReal(self) -> bool: ...
  69. def getIntValue(self, idx: int = ...) -> int: ...
  70. def getRealValue(self, idx: int = ...) -> float: ...
  71. def getStringValue(self, idx: int = ...) -> str: ...
  72. class Layer(cv2.Algorithm):
  73. blobs: _typing.Sequence[cv2.typing.MatLike]
  74. @property
  75. def name(self) -> str: ...
  76. @property
  77. def type(self) -> str: ...
  78. @property
  79. def preferableTarget(self) -> int: ...
  80. # Functions
  81. @_typing.overload
  82. def finalize(self, inputs: _typing.Sequence[cv2.typing.MatLike], outputs: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
  83. @_typing.overload
  84. def finalize(self, inputs: _typing.Sequence[cv2.UMat], outputs: _typing.Sequence[cv2.UMat] | None = ...) -> _typing.Sequence[cv2.UMat]: ...
  85. def run(self, inputs: _typing.Sequence[cv2.typing.MatLike], internals: _typing.Sequence[cv2.typing.MatLike], outputs: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> tuple[_typing.Sequence[cv2.typing.MatLike], _typing.Sequence[cv2.typing.MatLike]]: ...
  86. def outputNameToIndex(self, outputName: str) -> int: ...
  87. class Net:
  88. # Functions
  89. def __init__(self) -> None: ...
  90. @classmethod
  91. @_typing.overload
  92. def readFromModelOptimizer(cls, xml: str | os.PathLike[str], bin: str | os.PathLike[str]) -> Net: ...
  93. @classmethod
  94. @_typing.overload
  95. def readFromModelOptimizer(cls, bufferModelConfig: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferWeights: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]]) -> Net: ...
  96. def empty(self) -> bool: ...
  97. def dump(self) -> str: ...
  98. def dumpToFile(self, path: str | os.PathLike[str]) -> None: ...
  99. def dumpToPbtxt(self, path: str | os.PathLike[str]) -> None: ...
  100. def addLayer(self, name: str, type: str, dtype: int, params: cv2.typing.LayerParams) -> int: ...
  101. def addLayerToPrev(self, name: str, type: str, dtype: int, params: cv2.typing.LayerParams) -> int: ...
  102. def getLayerId(self, layer: str) -> int: ...
  103. def getLayerNames(self) -> _typing.Sequence[str]: ...
  104. @_typing.overload
  105. def getLayer(self, layerId: int) -> Layer: ...
  106. @_typing.overload
  107. def getLayer(self, layerName: str) -> Layer: ...
  108. @_typing.overload
  109. def getLayer(self, layerId: cv2.typing.LayerId) -> Layer: ...
  110. def connect(self, outPin: str, inpPin: str) -> None: ...
  111. def registerOutput(self, outputName: str, layerId: int, outputPort: int) -> int: ...
  112. def setInputsNames(self, inputBlobNames: _typing.Sequence[str]) -> None: ...
  113. def setInputShape(self, inputName: str, shape: cv2.typing.MatShape) -> None: ...
  114. @_typing.overload
  115. def forward(self, outputName: str = ...) -> cv2.typing.MatLike: ...
  116. @_typing.overload
  117. def forward(self, outputBlobs: _typing.Sequence[cv2.typing.MatLike] | None = ..., outputName: str = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
  118. @_typing.overload
  119. def forward(self, outputBlobs: _typing.Sequence[cv2.UMat] | None = ..., outputName: str = ...) -> _typing.Sequence[cv2.UMat]: ...
  120. @_typing.overload
  121. def forward(self, outBlobNames: _typing.Sequence[str], outputBlobs: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
  122. @_typing.overload
  123. def forward(self, outBlobNames: _typing.Sequence[str], outputBlobs: _typing.Sequence[cv2.UMat] | None = ...) -> _typing.Sequence[cv2.UMat]: ...
  124. def forwardAsync(self, outputName: str = ...) -> cv2.AsyncArray: ...
  125. def forwardAndRetrieve(self, outBlobNames: _typing.Sequence[str]) -> _typing.Sequence[_typing.Sequence[cv2.typing.MatLike]]: ...
  126. @_typing.overload
  127. def quantize(self, calibData: _typing.Sequence[cv2.typing.MatLike], inputsDtype: int, outputsDtype: int, perChannel: bool = ...) -> Net: ...
  128. @_typing.overload
  129. def quantize(self, calibData: _typing.Sequence[cv2.UMat], inputsDtype: int, outputsDtype: int, perChannel: bool = ...) -> Net: ...
  130. def getInputDetails(self) -> tuple[_typing.Sequence[float], _typing.Sequence[int]]: ...
  131. def getOutputDetails(self) -> tuple[_typing.Sequence[float], _typing.Sequence[int]]: ...
  132. def setHalideScheduler(self, scheduler: str) -> None: ...
  133. def setPreferableBackend(self, backendId: int) -> None: ...
  134. def setPreferableTarget(self, targetId: int) -> None: ...
  135. @_typing.overload
  136. def setInput(self, blob: cv2.typing.MatLike, name: str = ..., scalefactor: float = ..., mean: cv2.typing.Scalar = ...) -> None: ...
  137. @_typing.overload
  138. def setInput(self, blob: cv2.UMat, name: str = ..., scalefactor: float = ..., mean: cv2.typing.Scalar = ...) -> None: ...
  139. @_typing.overload
  140. def setParam(self, layer: int, numParam: int, blob: cv2.typing.MatLike) -> None: ...
  141. @_typing.overload
  142. def setParam(self, layerName: str, numParam: int, blob: cv2.typing.MatLike) -> None: ...
  143. @_typing.overload
  144. def getParam(self, layer: int, numParam: int = ...) -> cv2.typing.MatLike: ...
  145. @_typing.overload
  146. def getParam(self, layerName: str, numParam: int = ...) -> cv2.typing.MatLike: ...
  147. def getUnconnectedOutLayers(self) -> _typing.Sequence[int]: ...
  148. def getUnconnectedOutLayersNames(self) -> _typing.Sequence[str]: ...
  149. @_typing.overload
  150. def getLayersShapes(self, netInputShapes: _typing.Sequence[cv2.typing.MatShape]) -> tuple[_typing.Sequence[int], _typing.Sequence[_typing.Sequence[cv2.typing.MatShape]], _typing.Sequence[_typing.Sequence[cv2.typing.MatShape]]]: ...
  151. @_typing.overload
  152. def getLayersShapes(self, netInputShape: cv2.typing.MatShape) -> tuple[_typing.Sequence[int], _typing.Sequence[_typing.Sequence[cv2.typing.MatShape]], _typing.Sequence[_typing.Sequence[cv2.typing.MatShape]]]: ...
  153. @_typing.overload
  154. def getFLOPS(self, netInputShapes: _typing.Sequence[cv2.typing.MatShape]) -> int: ...
  155. @_typing.overload
  156. def getFLOPS(self, netInputShape: cv2.typing.MatShape) -> int: ...
  157. @_typing.overload
  158. def getFLOPS(self, layerId: int, netInputShapes: _typing.Sequence[cv2.typing.MatShape]) -> int: ...
  159. @_typing.overload
  160. def getFLOPS(self, layerId: int, netInputShape: cv2.typing.MatShape) -> int: ...
  161. def getLayerTypes(self) -> _typing.Sequence[str]: ...
  162. def getLayersCount(self, layerType: str) -> int: ...
  163. @_typing.overload
  164. def getMemoryConsumption(self, netInputShape: cv2.typing.MatShape) -> tuple[int, int]: ...
  165. @_typing.overload
  166. def getMemoryConsumption(self, layerId: int, netInputShapes: _typing.Sequence[cv2.typing.MatShape]) -> tuple[int, int]: ...
  167. @_typing.overload
  168. def getMemoryConsumption(self, layerId: int, netInputShape: cv2.typing.MatShape) -> tuple[int, int]: ...
  169. def enableFusion(self, fusion: bool) -> None: ...
  170. def enableWinograd(self, useWinograd: bool) -> None: ...
  171. def getPerfProfile(self) -> tuple[int, _typing.Sequence[float]]: ...
  172. class Image2BlobParams:
  173. scalefactor: cv2.typing.Scalar
  174. size: cv2.typing.Size
  175. mean: cv2.typing.Scalar
  176. swapRB: bool
  177. ddepth: int
  178. datalayout: DataLayout
  179. paddingmode: ImagePaddingMode
  180. borderValue: cv2.typing.Scalar
  181. # Functions
  182. @_typing.overload
  183. def __init__(self) -> None: ...
  184. @_typing.overload
  185. def __init__(self, scalefactor: cv2.typing.Scalar, size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., ddepth: int = ..., datalayout: DataLayout = ..., mode: ImagePaddingMode = ..., borderValue: cv2.typing.Scalar = ...) -> None: ...
  186. def blobRectToImageRect(self, rBlob: cv2.typing.Rect, size: cv2.typing.Size) -> cv2.typing.Rect: ...
  187. def blobRectsToImageRects(self, rBlob: _typing.Sequence[cv2.typing.Rect], size: cv2.typing.Size) -> _typing.Sequence[cv2.typing.Rect]: ...
  188. class Model:
  189. # Functions
  190. @_typing.overload
  191. def __init__(self, model: str | os.PathLike[str], config: str | os.PathLike[str] = ...) -> None: ...
  192. @_typing.overload
  193. def __init__(self, network: Net) -> None: ...
  194. @_typing.overload
  195. def setInputSize(self, size: cv2.typing.Size) -> Model: ...
  196. @_typing.overload
  197. def setInputSize(self, width: int, height: int) -> Model: ...
  198. def setInputMean(self, mean: cv2.typing.Scalar) -> Model: ...
  199. def setInputScale(self, scale: cv2.typing.Scalar) -> Model: ...
  200. def setInputCrop(self, crop: bool) -> Model: ...
  201. def setInputSwapRB(self, swapRB: bool) -> Model: ...
  202. def setOutputNames(self, outNames: _typing.Sequence[str]) -> Model: ...
  203. def setInputParams(self, scale: float = ..., size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., crop: bool = ...) -> None: ...
  204. @_typing.overload
  205. def predict(self, frame: cv2.typing.MatLike, outs: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
  206. @_typing.overload
  207. def predict(self, frame: cv2.UMat, outs: _typing.Sequence[cv2.UMat] | None = ...) -> _typing.Sequence[cv2.UMat]: ...
  208. def setPreferableBackend(self, backendId: Backend) -> Model: ...
  209. def setPreferableTarget(self, targetId: Target) -> Model: ...
  210. def enableWinograd(self, useWinograd: bool) -> Model: ...
  211. class ClassificationModel(Model):
  212. # Functions
  213. @_typing.overload
  214. def __init__(self, model: str | os.PathLike[str], config: str | os.PathLike[str] = ...) -> None: ...
  215. @_typing.overload
  216. def __init__(self, network: Net) -> None: ...
  217. def setEnableSoftmaxPostProcessing(self, enable: bool) -> ClassificationModel: ...
  218. def getEnableSoftmaxPostProcessing(self) -> bool: ...
  219. @_typing.overload
  220. def classify(self, frame: cv2.typing.MatLike) -> tuple[int, float]: ...
  221. @_typing.overload
  222. def classify(self, frame: cv2.UMat) -> tuple[int, float]: ...
  223. class KeypointsModel(Model):
  224. # Functions
  225. @_typing.overload
  226. def __init__(self, model: str | os.PathLike[str], config: str | os.PathLike[str] = ...) -> None: ...
  227. @_typing.overload
  228. def __init__(self, network: Net) -> None: ...
  229. @_typing.overload
  230. def estimate(self, frame: cv2.typing.MatLike, thresh: float = ...) -> _typing.Sequence[cv2.typing.Point2f]: ...
  231. @_typing.overload
  232. def estimate(self, frame: cv2.UMat, thresh: float = ...) -> _typing.Sequence[cv2.typing.Point2f]: ...
  233. class SegmentationModel(Model):
  234. # Functions
  235. @_typing.overload
  236. def __init__(self, model: str | os.PathLike[str], config: str | os.PathLike[str] = ...) -> None: ...
  237. @_typing.overload
  238. def __init__(self, network: Net) -> None: ...
  239. @_typing.overload
  240. def segment(self, frame: cv2.typing.MatLike, mask: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
  241. @_typing.overload
  242. def segment(self, frame: cv2.UMat, mask: cv2.UMat | None = ...) -> cv2.UMat: ...
  243. class DetectionModel(Model):
  244. # Functions
  245. @_typing.overload
  246. def __init__(self, model: str | os.PathLike[str], config: str | os.PathLike[str] = ...) -> None: ...
  247. @_typing.overload
  248. def __init__(self, network: Net) -> None: ...
  249. def setNmsAcrossClasses(self, value: bool) -> DetectionModel: ...
  250. def getNmsAcrossClasses(self) -> bool: ...
  251. @_typing.overload
  252. def detect(self, frame: cv2.typing.MatLike, confThreshold: float = ..., nmsThreshold: float = ...) -> tuple[_typing.Sequence[int], _typing.Sequence[float], _typing.Sequence[cv2.typing.Rect]]: ...
  253. @_typing.overload
  254. def detect(self, frame: cv2.UMat, confThreshold: float = ..., nmsThreshold: float = ...) -> tuple[_typing.Sequence[int], _typing.Sequence[float], _typing.Sequence[cv2.typing.Rect]]: ...
  255. class TextRecognitionModel(Model):
  256. # Functions
  257. @_typing.overload
  258. def __init__(self, network: Net) -> None: ...
  259. @_typing.overload
  260. def __init__(self, model: str | os.PathLike[str], config: str | os.PathLike[str] = ...) -> None: ...
  261. def setDecodeType(self, decodeType: str) -> TextRecognitionModel: ...
  262. def getDecodeType(self) -> str: ...
  263. def setDecodeOptsCTCPrefixBeamSearch(self, beamSize: int, vocPruneSize: int = ...) -> TextRecognitionModel: ...
  264. def setVocabulary(self, vocabulary: _typing.Sequence[str]) -> TextRecognitionModel: ...
  265. def getVocabulary(self) -> _typing.Sequence[str]: ...
  266. @_typing.overload
  267. def recognize(self, frame: cv2.typing.MatLike) -> str: ...
  268. @_typing.overload
  269. def recognize(self, frame: cv2.UMat) -> str: ...
  270. @_typing.overload
  271. def recognize(self, frame: cv2.typing.MatLike, roiRects: _typing.Sequence[cv2.typing.MatLike]) -> _typing.Sequence[str]: ...
  272. @_typing.overload
  273. def recognize(self, frame: cv2.UMat, roiRects: _typing.Sequence[cv2.UMat]) -> _typing.Sequence[str]: ...
  274. class TextDetectionModel(Model):
  275. # Functions
  276. @_typing.overload
  277. def detect(self, frame: cv2.typing.MatLike) -> tuple[_typing.Sequence[_typing.Sequence[cv2.typing.Point]], _typing.Sequence[float]]: ...
  278. @_typing.overload
  279. def detect(self, frame: cv2.UMat) -> tuple[_typing.Sequence[_typing.Sequence[cv2.typing.Point]], _typing.Sequence[float]]: ...
  280. @_typing.overload
  281. def detect(self, frame: cv2.typing.MatLike) -> _typing.Sequence[_typing.Sequence[cv2.typing.Point]]: ...
  282. @_typing.overload
  283. def detect(self, frame: cv2.UMat) -> _typing.Sequence[_typing.Sequence[cv2.typing.Point]]: ...
  284. @_typing.overload
  285. def detectTextRectangles(self, frame: cv2.typing.MatLike) -> tuple[_typing.Sequence[cv2.typing.RotatedRect], _typing.Sequence[float]]: ...
  286. @_typing.overload
  287. def detectTextRectangles(self, frame: cv2.UMat) -> tuple[_typing.Sequence[cv2.typing.RotatedRect], _typing.Sequence[float]]: ...
  288. @_typing.overload
  289. def detectTextRectangles(self, frame: cv2.typing.MatLike) -> _typing.Sequence[cv2.typing.RotatedRect]: ...
  290. @_typing.overload
  291. def detectTextRectangles(self, frame: cv2.UMat) -> _typing.Sequence[cv2.typing.RotatedRect]: ...
  292. class TextDetectionModel_EAST(TextDetectionModel):
  293. # Functions
  294. @_typing.overload
  295. def __init__(self, network: Net) -> None: ...
  296. @_typing.overload
  297. def __init__(self, model: str | os.PathLike[str], config: str | os.PathLike[str] = ...) -> None: ...
  298. def setConfidenceThreshold(self, confThreshold: float) -> TextDetectionModel_EAST: ...
  299. def getConfidenceThreshold(self) -> float: ...
  300. def setNMSThreshold(self, nmsThreshold: float) -> TextDetectionModel_EAST: ...
  301. def getNMSThreshold(self) -> float: ...
  302. class TextDetectionModel_DB(TextDetectionModel):
  303. # Functions
  304. @_typing.overload
  305. def __init__(self, network: Net) -> None: ...
  306. @_typing.overload
  307. def __init__(self, model: str | os.PathLike[str], config: str | os.PathLike[str] = ...) -> None: ...
  308. def setBinaryThreshold(self, binaryThreshold: float) -> TextDetectionModel_DB: ...
  309. def getBinaryThreshold(self) -> float: ...
  310. def setPolygonThreshold(self, polygonThreshold: float) -> TextDetectionModel_DB: ...
  311. def getPolygonThreshold(self) -> float: ...
  312. def setUnclipRatio(self, unclipRatio: float) -> TextDetectionModel_DB: ...
  313. def getUnclipRatio(self) -> float: ...
  314. def setMaxCandidates(self, maxCandidates: int) -> TextDetectionModel_DB: ...
  315. def getMaxCandidates(self) -> int: ...
  316. class LayerProtocol(Protocol):
  317. # Functions
  318. def __init__(self, params: dict[str, DictValue], blobs: _typing.Sequence[cv2.typing.MatLike]) -> None: ...
  319. def getMemoryShapes(self, inputs: _typing.Sequence[_typing.Sequence[int]]) -> _typing.Sequence[_typing.Sequence[int]]: ...
  320. def forward(self, inputs: _typing.Sequence[cv2.typing.MatLike]) -> _typing.Sequence[cv2.typing.MatLike]: ...
  321. # Functions
  322. def NMSBoxes(bboxes: _typing.Sequence[cv2.typing.Rect2d], scores: _typing.Sequence[float], score_threshold: float, nms_threshold: float, eta: float = ..., top_k: int = ...) -> _typing.Sequence[int]: ...
  323. def NMSBoxesBatched(bboxes: _typing.Sequence[cv2.typing.Rect2d], scores: _typing.Sequence[float], class_ids: _typing.Sequence[int], score_threshold: float, nms_threshold: float, eta: float = ..., top_k: int = ...) -> _typing.Sequence[int]: ...
  324. def NMSBoxesRotated(bboxes: _typing.Sequence[cv2.typing.RotatedRect], scores: _typing.Sequence[float], score_threshold: float, nms_threshold: float, eta: float = ..., top_k: int = ...) -> _typing.Sequence[int]: ...
  325. @_typing.overload
  326. def blobFromImage(image: cv2.typing.MatLike, scalefactor: float = ..., size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., crop: bool = ..., ddepth: int = ...) -> cv2.typing.MatLike: ...
  327. @_typing.overload
  328. def blobFromImage(image: cv2.UMat, scalefactor: float = ..., size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., crop: bool = ..., ddepth: int = ...) -> cv2.typing.MatLike: ...
  329. @_typing.overload
  330. def blobFromImageWithParams(image: cv2.typing.MatLike, param: Image2BlobParams = ...) -> cv2.typing.MatLike: ...
  331. @_typing.overload
  332. def blobFromImageWithParams(image: cv2.UMat, param: Image2BlobParams = ...) -> cv2.typing.MatLike: ...
  333. @_typing.overload
  334. def blobFromImageWithParams(image: cv2.typing.MatLike, blob: cv2.typing.MatLike | None = ..., param: Image2BlobParams = ...) -> cv2.typing.MatLike: ...
  335. @_typing.overload
  336. def blobFromImageWithParams(image: cv2.UMat, blob: cv2.UMat | None = ..., param: Image2BlobParams = ...) -> cv2.UMat: ...
  337. @_typing.overload
  338. def blobFromImages(images: _typing.Sequence[cv2.typing.MatLike], scalefactor: float = ..., size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., crop: bool = ..., ddepth: int = ...) -> cv2.typing.MatLike: ...
  339. @_typing.overload
  340. def blobFromImages(images: _typing.Sequence[cv2.UMat], scalefactor: float = ..., size: cv2.typing.Size = ..., mean: cv2.typing.Scalar = ..., swapRB: bool = ..., crop: bool = ..., ddepth: int = ...) -> cv2.typing.MatLike: ...
  341. @_typing.overload
  342. def blobFromImagesWithParams(images: _typing.Sequence[cv2.typing.MatLike], param: Image2BlobParams = ...) -> cv2.typing.MatLike: ...
  343. @_typing.overload
  344. def blobFromImagesWithParams(images: _typing.Sequence[cv2.UMat], param: Image2BlobParams = ...) -> cv2.typing.MatLike: ...
  345. @_typing.overload
  346. def blobFromImagesWithParams(images: _typing.Sequence[cv2.typing.MatLike], blob: cv2.typing.MatLike | None = ..., param: Image2BlobParams = ...) -> cv2.typing.MatLike: ...
  347. @_typing.overload
  348. def blobFromImagesWithParams(images: _typing.Sequence[cv2.UMat], blob: cv2.UMat | None = ..., param: Image2BlobParams = ...) -> cv2.UMat: ...
  349. def getAvailableTargets(be: Backend) -> _typing.Sequence[Target]: ...
  350. def getInferenceEngineBackendType() -> str: ...
  351. def getInferenceEngineCPUType() -> str: ...
  352. def getInferenceEngineVPUType() -> str: ...
  353. @_typing.overload
  354. def imagesFromBlob(blob_: cv2.typing.MatLike, images_: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> _typing.Sequence[cv2.typing.MatLike]: ...
  355. @_typing.overload
  356. def imagesFromBlob(blob_: cv2.typing.MatLike, images_: _typing.Sequence[cv2.UMat] | None = ...) -> _typing.Sequence[cv2.UMat]: ...
  357. @_typing.overload
  358. def readNet(model: str | os.PathLike[str], config: str | os.PathLike[str] = ..., framework: str = ...) -> Net: ...
  359. @_typing.overload
  360. def readNet(framework: str, bufferModel: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferConfig: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]] = ...) -> Net: ...
  361. @_typing.overload
  362. def readNetFromCaffe(prototxt: str | os.PathLike[str], caffeModel: str | os.PathLike[str] = ...) -> Net: ...
  363. @_typing.overload
  364. def readNetFromCaffe(bufferProto: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferModel: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]] = ...) -> Net: ...
  365. @_typing.overload
  366. def readNetFromDarknet(cfgFile: str | os.PathLike[str], darknetModel: str | os.PathLike[str] = ...) -> Net: ...
  367. @_typing.overload
  368. def readNetFromDarknet(bufferCfg: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferModel: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]] = ...) -> Net: ...
  369. @_typing.overload
  370. def readNetFromModelOptimizer(xml: str | os.PathLike[str], bin: str | os.PathLike[str] = ...) -> Net: ...
  371. @_typing.overload
  372. def readNetFromModelOptimizer(bufferModelConfig: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferWeights: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]]) -> Net: ...
  373. @_typing.overload
  374. def readNetFromONNX(onnxFile: str | os.PathLike[str]) -> Net: ...
  375. @_typing.overload
  376. def readNetFromONNX(buffer: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]]) -> Net: ...
  377. @_typing.overload
  378. def readNetFromTFLite(model: str | os.PathLike[str]) -> Net: ...
  379. @_typing.overload
  380. def readNetFromTFLite(bufferModel: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]]) -> Net: ...
  381. @_typing.overload
  382. def readNetFromTensorflow(model: str | os.PathLike[str], config: str | os.PathLike[str] = ...) -> Net: ...
  383. @_typing.overload
  384. def readNetFromTensorflow(bufferModel: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]], bufferConfig: numpy.ndarray[_typing.Any, numpy.dtype[numpy.uint8]] = ...) -> Net: ...
  385. def readNetFromTorch(model: str | os.PathLike[str], isBinary: bool = ..., evaluate: bool = ...) -> Net: ...
  386. def readTensorFromONNX(path: str | os.PathLike[str]) -> cv2.typing.MatLike: ...
  387. def readTorchBlob(filename: str | os.PathLike[str], isBinary: bool = ...) -> cv2.typing.MatLike: ...
  388. def releaseHDDLPlugin() -> None: ...
  389. def resetMyriadDevice() -> None: ...
  390. def setInferenceEngineBackendType(newBackendType: str) -> str: ...
  391. def shrinkCaffeModel(src: str | os.PathLike[str], dst: str | os.PathLike[str], layersTypes: _typing.Sequence[str] = ...) -> None: ...
  392. def softNMSBoxes(bboxes: _typing.Sequence[cv2.typing.Rect], scores: _typing.Sequence[float], score_threshold: float, nms_threshold: float, top_k: int = ..., sigma: float = ..., method: SoftNMSMethod = ...) -> tuple[_typing.Sequence[float], _typing.Sequence[int]]: ...
  393. def writeTextGraph(model: str | os.PathLike[str], output: str | os.PathLike[str]) -> None: ...