SegmentationModel.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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/dnn.hpp"
  8. #import "opencv2/dnn/dnn.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. #import "Model.h"
  14. @class Mat;
  15. @class Net;
  16. NS_ASSUME_NONNULL_BEGIN
  17. // C++: class SegmentationModel
  18. /**
  19. * This class represents high-level API for segmentation models
  20. *
  21. * SegmentationModel allows to set params for preprocessing input image.
  22. * SegmentationModel creates net from file with trained weights and config,
  23. * sets preprocessing input, runs forward pass and returns the class prediction for each pixel.
  24. *
  25. * Member of `Dnn`
  26. */
  27. CV_EXPORTS @interface SegmentationModel : Model
  28. #ifdef __cplusplus
  29. @property(readonly)cv::Ptr<cv::dnn::SegmentationModel> nativePtrSegmentationModel;
  30. #endif
  31. #ifdef __cplusplus
  32. - (instancetype)initWithNativePtr:(cv::Ptr<cv::dnn::SegmentationModel>)nativePtr;
  33. + (instancetype)fromNative:(cv::Ptr<cv::dnn::SegmentationModel>)nativePtr;
  34. #endif
  35. #pragma mark - Methods
  36. //
  37. // cv::dnn::SegmentationModel::SegmentationModel(String model, String config = "")
  38. //
  39. /**
  40. * Create segmentation model from network represented in one of the supported formats.
  41. * An order of @p model and @p config arguments does not matter.
  42. * @param model Binary file contains trained weights.
  43. * @param config Text file contains network configuration.
  44. */
  45. - (instancetype)initWithModel:(NSString*)model config:(NSString*)config;
  46. /**
  47. * Create segmentation model from network represented in one of the supported formats.
  48. * An order of @p model and @p config arguments does not matter.
  49. * @param model Binary file contains trained weights.
  50. */
  51. - (instancetype)initWithModel:(NSString*)model;
  52. //
  53. // cv::dnn::SegmentationModel::SegmentationModel(Net network)
  54. //
  55. /**
  56. * Create model from deep learning network.
  57. * @param network Net object.
  58. */
  59. - (instancetype)initWithNetwork:(Net*)network;
  60. //
  61. // void cv::dnn::SegmentationModel::segment(Mat frame, Mat& mask)
  62. //
  63. /**
  64. * Given the @p input frame, create input blob, run net
  65. * @param mask Allocated class prediction for each pixel
  66. */
  67. - (void)segment:(Mat*)frame mask:(Mat*)mask NS_SWIFT_NAME(segment(frame:mask:));
  68. @end
  69. NS_ASSUME_NONNULL_END