目录

class info
com.huawei.hms.mlsdk.face.MLMaxSizeFaceTransactor
Represents the largest face processor, which processes only the largest face in an image at a certain time. (For details, please refer to Smile Camera on GitHub.)

Sample Code

  1. // Create a face analyzer.
  2. MLFaceAnalyzer analyzer = MLAnalyzerFactory.getInstance().getFaceAnalyzer();
  3. // Create a largest face processor to recognize the largest face and pass the result to MLResMLResultTrailerprocessing. MLResMLResultTrailer base class, which needs to be inherited and implemented by developers based on service logic.
  4. MLMaxSizeFaceTransactor transactor = new MLMaxSizeFaceTransactor.Creator(analyzer, new MLResultTrailer<MLFace>()).create();
  5. analyzer.setTransactor(transactor);
  6. // The processor is used only for real-time video detection and is invalid for single image detection.
  7. LensEngine lensEngine = new LensEngine.Creator(context, analyzer)
  8.   .applyDisplayDimension(640, 480)
  9.   .create();