__init__.pyi 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. __all__: list[str] = []
  2. import cv2
  3. import cv2.typing
  4. import typing as _typing
  5. # Classes
  6. class FaceRecognizer(cv2.Algorithm):
  7. # Functions
  8. @_typing.overload
  9. def train(self, src: _typing.Sequence[cv2.typing.MatLike], labels: cv2.typing.MatLike) -> None: ...
  10. @_typing.overload
  11. def train(self, src: _typing.Sequence[cv2.UMat], labels: cv2.UMat) -> None: ...
  12. @_typing.overload
  13. def update(self, src: _typing.Sequence[cv2.typing.MatLike], labels: cv2.typing.MatLike) -> None: ...
  14. @_typing.overload
  15. def update(self, src: _typing.Sequence[cv2.UMat], labels: cv2.UMat) -> None: ...
  16. @_typing.overload
  17. def predict_label(self, src: cv2.typing.MatLike) -> int: ...
  18. @_typing.overload
  19. def predict_label(self, src: cv2.UMat) -> int: ...
  20. @_typing.overload
  21. def predict(self, src: cv2.typing.MatLike) -> tuple[int, float]: ...
  22. @_typing.overload
  23. def predict(self, src: cv2.UMat) -> tuple[int, float]: ...
  24. @_typing.overload
  25. def predict_collect(self, src: cv2.typing.MatLike, collector: PredictCollector) -> None: ...
  26. @_typing.overload
  27. def predict_collect(self, src: cv2.UMat, collector: PredictCollector) -> None: ...
  28. def write(self, filename: str) -> None: ...
  29. def read(self, filename: str) -> None: ...
  30. def setLabelInfo(self, label: int, strInfo: str) -> None: ...
  31. def getLabelInfo(self, label: int) -> str: ...
  32. def getLabelsByString(self, str: str) -> _typing.Sequence[int]: ...
  33. class BIF(cv2.Algorithm):
  34. # Functions
  35. def getNumBands(self) -> int: ...
  36. def getNumRotations(self) -> int: ...
  37. @_typing.overload
  38. def compute(self, image: cv2.typing.MatLike, features: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
  39. @_typing.overload
  40. def compute(self, image: cv2.UMat, features: cv2.UMat | None = ...) -> cv2.UMat: ...
  41. @classmethod
  42. def create(cls, num_bands: int = ..., num_rotations: int = ...) -> BIF: ...
  43. class FacemarkKazemi(Facemark):
  44. ...
  45. class Facemark(cv2.Algorithm):
  46. # Functions
  47. def loadModel(self, model: str) -> None: ...
  48. @_typing.overload
  49. def fit(self, image: cv2.typing.MatLike, faces: cv2.typing.MatLike, landmarks: _typing.Sequence[cv2.typing.MatLike] | None = ...) -> tuple[bool, _typing.Sequence[cv2.typing.MatLike]]: ...
  50. @_typing.overload
  51. def fit(self, image: cv2.UMat, faces: cv2.UMat, landmarks: _typing.Sequence[cv2.UMat] | None = ...) -> tuple[bool, _typing.Sequence[cv2.UMat]]: ...
  52. class FacemarkAAM(FacemarkTrain):
  53. ...
  54. class FacemarkTrain(Facemark):
  55. ...
  56. class FacemarkLBF(FacemarkTrain):
  57. ...
  58. class BasicFaceRecognizer(FaceRecognizer):
  59. # Functions
  60. def getNumComponents(self) -> int: ...
  61. def setNumComponents(self, val: int) -> None: ...
  62. def getThreshold(self) -> float: ...
  63. def setThreshold(self, val: float) -> None: ...
  64. def getProjections(self) -> _typing.Sequence[cv2.typing.MatLike]: ...
  65. def getLabels(self) -> cv2.typing.MatLike: ...
  66. def getEigenValues(self) -> cv2.typing.MatLike: ...
  67. def getEigenVectors(self) -> cv2.typing.MatLike: ...
  68. def getMean(self) -> cv2.typing.MatLike: ...
  69. class EigenFaceRecognizer(BasicFaceRecognizer):
  70. # Functions
  71. @classmethod
  72. def create(cls, num_components: int = ..., threshold: float = ...) -> EigenFaceRecognizer: ...
  73. class FisherFaceRecognizer(BasicFaceRecognizer):
  74. # Functions
  75. @classmethod
  76. def create(cls, num_components: int = ..., threshold: float = ...) -> FisherFaceRecognizer: ...
  77. class LBPHFaceRecognizer(FaceRecognizer):
  78. # Functions
  79. def getGridX(self) -> int: ...
  80. def setGridX(self, val: int) -> None: ...
  81. def getGridY(self) -> int: ...
  82. def setGridY(self, val: int) -> None: ...
  83. def getRadius(self) -> int: ...
  84. def setRadius(self, val: int) -> None: ...
  85. def getNeighbors(self) -> int: ...
  86. def setNeighbors(self, val: int) -> None: ...
  87. def getThreshold(self) -> float: ...
  88. def setThreshold(self, val: float) -> None: ...
  89. def getHistograms(self) -> _typing.Sequence[cv2.typing.MatLike]: ...
  90. def getLabels(self) -> cv2.typing.MatLike: ...
  91. @classmethod
  92. def create(cls, radius: int = ..., neighbors: int = ..., grid_x: int = ..., grid_y: int = ..., threshold: float = ...) -> LBPHFaceRecognizer: ...
  93. class MACE(cv2.Algorithm):
  94. # Functions
  95. def salt(self, passphrase: str) -> None: ...
  96. @_typing.overload
  97. def train(self, images: _typing.Sequence[cv2.typing.MatLike]) -> None: ...
  98. @_typing.overload
  99. def train(self, images: _typing.Sequence[cv2.UMat]) -> None: ...
  100. @_typing.overload
  101. def same(self, query: cv2.typing.MatLike) -> bool: ...
  102. @_typing.overload
  103. def same(self, query: cv2.UMat) -> bool: ...
  104. @classmethod
  105. def load(cls, filename: str, objname: str = ...) -> MACE: ...
  106. @classmethod
  107. def create(cls, IMGSIZE: int = ...) -> MACE: ...
  108. class PredictCollector:
  109. ...
  110. class StandardCollector(PredictCollector):
  111. # Functions
  112. def getMinLabel(self) -> int: ...
  113. def getMinDist(self) -> float: ...
  114. def getResults(self, sorted: bool = ...) -> _typing.Sequence[tuple[int, float]]: ...
  115. @classmethod
  116. def create(cls, threshold: float = ...) -> StandardCollector: ...
  117. # Functions
  118. def createFacemarkAAM() -> Facemark: ...
  119. def createFacemarkKazemi() -> Facemark: ...
  120. def createFacemarkLBF() -> Facemark: ...
  121. @_typing.overload
  122. def drawFacemarks(image: cv2.typing.MatLike, points: cv2.typing.MatLike, color: cv2.typing.Scalar = ...) -> cv2.typing.MatLike: ...
  123. @_typing.overload
  124. def drawFacemarks(image: cv2.UMat, points: cv2.UMat, color: cv2.typing.Scalar = ...) -> cv2.UMat: ...
  125. @_typing.overload
  126. def getFacesHAAR(image: cv2.typing.MatLike, face_cascade_name: str, faces: cv2.typing.MatLike | None = ...) -> tuple[bool, cv2.typing.MatLike]: ...
  127. @_typing.overload
  128. def getFacesHAAR(image: cv2.UMat, face_cascade_name: str, faces: cv2.UMat | None = ...) -> tuple[bool, cv2.UMat]: ...
  129. def loadDatasetList(imageList: str, annotationList: str, images: _typing.Sequence[str], annotations: _typing.Sequence[str]) -> bool: ...
  130. @_typing.overload
  131. def loadFacePoints(filename: str, points: cv2.typing.MatLike | None = ..., offset: float = ...) -> tuple[bool, cv2.typing.MatLike]: ...
  132. @_typing.overload
  133. def loadFacePoints(filename: str, points: cv2.UMat | None = ..., offset: float = ...) -> tuple[bool, cv2.UMat]: ...
  134. @_typing.overload
  135. def loadTrainingData(filename: str, images: _typing.Sequence[str], facePoints: cv2.typing.MatLike | None = ..., delim: str = ..., offset: float = ...) -> tuple[bool, cv2.typing.MatLike]: ...
  136. @_typing.overload
  137. def loadTrainingData(filename: str, images: _typing.Sequence[str], facePoints: cv2.UMat | None = ..., delim: str = ..., offset: float = ...) -> tuple[bool, cv2.UMat]: ...
  138. @_typing.overload
  139. def loadTrainingData(imageList: str, groundTruth: str, images: _typing.Sequence[str], facePoints: cv2.typing.MatLike | None = ..., offset: float = ...) -> tuple[bool, cv2.typing.MatLike]: ...
  140. @_typing.overload
  141. def loadTrainingData(imageList: str, groundTruth: str, images: _typing.Sequence[str], facePoints: cv2.UMat | None = ..., offset: float = ...) -> tuple[bool, cv2.UMat]: ...
  142. @_typing.overload
  143. def loadTrainingData(filename: _typing.Sequence[str], trainlandmarks: _typing.Sequence[_typing.Sequence[cv2.typing.Point2f]], trainimages: _typing.Sequence[str]) -> bool: ...