FaceDetectorYN.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. //
  2. // This file is auto-generated. Please don't modify it!
  3. //
  4. #pragma once
  5. #ifdef __cplusplus
  6. //#import "opencv.hpp"
  7. #import "opencv2/objdetect.hpp"
  8. #import "opencv2/objdetect/face.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. @class Mat;
  14. @class Size2i;
  15. NS_ASSUME_NONNULL_BEGIN
  16. // C++: class FaceDetectorYN
  17. /**
  18. * DNN-based face detector
  19. *
  20. * model download link: https://github.com/opencv/opencv_zoo/tree/master/models/face_detection_yunet
  21. *
  22. * Member of `Objdetect`
  23. */
  24. CV_EXPORTS @interface FaceDetectorYN : NSObject
  25. #ifdef __cplusplus
  26. @property(readonly)cv::Ptr<cv::FaceDetectorYN> nativePtr;
  27. #endif
  28. #ifdef __cplusplus
  29. - (instancetype)initWithNativePtr:(cv::Ptr<cv::FaceDetectorYN>)nativePtr;
  30. + (instancetype)fromNative:(cv::Ptr<cv::FaceDetectorYN>)nativePtr;
  31. #endif
  32. #pragma mark - Methods
  33. //
  34. // void cv::FaceDetectorYN::setInputSize(Size input_size)
  35. //
  36. /**
  37. * Set the size for the network input, which overwrites the input size of creating model. Call this method when the size of input image does not match the input size when creating model
  38. *
  39. * @param input_size the size of the input image
  40. */
  41. - (void)setInputSize:(Size2i*)input_size NS_SWIFT_NAME(setInputSize(input_size:));
  42. //
  43. // Size cv::FaceDetectorYN::getInputSize()
  44. //
  45. - (Size2i*)getInputSize NS_SWIFT_NAME(getInputSize());
  46. //
  47. // void cv::FaceDetectorYN::setScoreThreshold(float score_threshold)
  48. //
  49. /**
  50. * Set the score threshold to filter out bounding boxes of score less than the given value
  51. *
  52. * @param score_threshold threshold for filtering out bounding boxes
  53. */
  54. - (void)setScoreThreshold:(float)score_threshold NS_SWIFT_NAME(setScoreThreshold(score_threshold:));
  55. //
  56. // float cv::FaceDetectorYN::getScoreThreshold()
  57. //
  58. - (float)getScoreThreshold NS_SWIFT_NAME(getScoreThreshold());
  59. //
  60. // void cv::FaceDetectorYN::setNMSThreshold(float nms_threshold)
  61. //
  62. /**
  63. * Set the Non-maximum-suppression threshold to suppress bounding boxes that have IoU greater than the given value
  64. *
  65. * @param nms_threshold threshold for NMS operation
  66. */
  67. - (void)setNMSThreshold:(float)nms_threshold NS_SWIFT_NAME(setNMSThreshold(nms_threshold:));
  68. //
  69. // float cv::FaceDetectorYN::getNMSThreshold()
  70. //
  71. - (float)getNMSThreshold NS_SWIFT_NAME(getNMSThreshold());
  72. //
  73. // void cv::FaceDetectorYN::setTopK(int top_k)
  74. //
  75. /**
  76. * Set the number of bounding boxes preserved before NMS
  77. *
  78. * @param top_k the number of bounding boxes to preserve from top rank based on score
  79. */
  80. - (void)setTopK:(int)top_k NS_SWIFT_NAME(setTopK(top_k:));
  81. //
  82. // int cv::FaceDetectorYN::getTopK()
  83. //
  84. - (int)getTopK NS_SWIFT_NAME(getTopK());
  85. //
  86. // int cv::FaceDetectorYN::detect(Mat image, Mat& faces)
  87. //
  88. /**
  89. * A simple interface to detect face from given image
  90. *
  91. * @param image an image to detect
  92. * @param faces detection results stored in a cv::Mat
  93. */
  94. - (int)detect:(Mat*)image faces:(Mat*)faces NS_SWIFT_NAME(detect(image:faces:));
  95. //
  96. // static Ptr_FaceDetectorYN cv::FaceDetectorYN::create(String model, String config, Size input_size, float score_threshold = 0.9f, float nms_threshold = 0.3f, int top_k = 5000, int backend_id = 0, int target_id = 0)
  97. //
  98. /**
  99. * Creates an instance of this class with given parameters
  100. *
  101. * @param model the path to the requested model
  102. * @param config the path to the config file for compability, which is not requested for ONNX models
  103. * @param input_size the size of the input image
  104. * @param score_threshold the threshold to filter out bounding boxes of score smaller than the given value
  105. * @param nms_threshold the threshold to suppress bounding boxes of IoU bigger than the given value
  106. * @param top_k keep top K bboxes before NMS
  107. * @param backend_id the id of backend
  108. * @param target_id the id of target device
  109. */
  110. + (FaceDetectorYN*)create:(NSString*)model config:(NSString*)config input_size:(Size2i*)input_size score_threshold:(float)score_threshold nms_threshold:(float)nms_threshold top_k:(int)top_k backend_id:(int)backend_id target_id:(int)target_id NS_SWIFT_NAME(create(model:config:input_size:score_threshold:nms_threshold:top_k:backend_id:target_id:));
  111. /**
  112. * Creates an instance of this class with given parameters
  113. *
  114. * @param model the path to the requested model
  115. * @param config the path to the config file for compability, which is not requested for ONNX models
  116. * @param input_size the size of the input image
  117. * @param score_threshold the threshold to filter out bounding boxes of score smaller than the given value
  118. * @param nms_threshold the threshold to suppress bounding boxes of IoU bigger than the given value
  119. * @param top_k keep top K bboxes before NMS
  120. * @param backend_id the id of backend
  121. */
  122. + (FaceDetectorYN*)create:(NSString*)model config:(NSString*)config input_size:(Size2i*)input_size score_threshold:(float)score_threshold nms_threshold:(float)nms_threshold top_k:(int)top_k backend_id:(int)backend_id NS_SWIFT_NAME(create(model:config:input_size:score_threshold:nms_threshold:top_k:backend_id:));
  123. /**
  124. * Creates an instance of this class with given parameters
  125. *
  126. * @param model the path to the requested model
  127. * @param config the path to the config file for compability, which is not requested for ONNX models
  128. * @param input_size the size of the input image
  129. * @param score_threshold the threshold to filter out bounding boxes of score smaller than the given value
  130. * @param nms_threshold the threshold to suppress bounding boxes of IoU bigger than the given value
  131. * @param top_k keep top K bboxes before NMS
  132. */
  133. + (FaceDetectorYN*)create:(NSString*)model config:(NSString*)config input_size:(Size2i*)input_size score_threshold:(float)score_threshold nms_threshold:(float)nms_threshold top_k:(int)top_k NS_SWIFT_NAME(create(model:config:input_size:score_threshold:nms_threshold:top_k:));
  134. /**
  135. * Creates an instance of this class with given parameters
  136. *
  137. * @param model the path to the requested model
  138. * @param config the path to the config file for compability, which is not requested for ONNX models
  139. * @param input_size the size of the input image
  140. * @param score_threshold the threshold to filter out bounding boxes of score smaller than the given value
  141. * @param nms_threshold the threshold to suppress bounding boxes of IoU bigger than the given value
  142. */
  143. + (FaceDetectorYN*)create:(NSString*)model config:(NSString*)config input_size:(Size2i*)input_size score_threshold:(float)score_threshold nms_threshold:(float)nms_threshold NS_SWIFT_NAME(create(model:config:input_size:score_threshold:nms_threshold:));
  144. /**
  145. * Creates an instance of this class with given parameters
  146. *
  147. * @param model the path to the requested model
  148. * @param config the path to the config file for compability, which is not requested for ONNX models
  149. * @param input_size the size of the input image
  150. * @param score_threshold the threshold to filter out bounding boxes of score smaller than the given value
  151. */
  152. + (FaceDetectorYN*)create:(NSString*)model config:(NSString*)config input_size:(Size2i*)input_size score_threshold:(float)score_threshold NS_SWIFT_NAME(create(model:config:input_size:score_threshold:));
  153. /**
  154. * Creates an instance of this class with given parameters
  155. *
  156. * @param model the path to the requested model
  157. * @param config the path to the config file for compability, which is not requested for ONNX models
  158. * @param input_size the size of the input image
  159. */
  160. + (FaceDetectorYN*)create:(NSString*)model config:(NSString*)config input_size:(Size2i*)input_size NS_SWIFT_NAME(create(model:config:input_size:));
  161. @end
  162. NS_ASSUME_NONNULL_END