__init__.pyi 21 KB

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