Skip to content

Instantly share code, notes, and snippets.

@yektasarioglu
Last active November 30, 2020 19:18
Show Gist options
  • Save yektasarioglu/aa635b8fb6cdde43d22384113accf106 to your computer and use it in GitHub Desktop.
Save yektasarioglu/aa635b8fb6cdde43d22384113accf106 to your computer and use it in GitHub Desktop.
Initialize Analyzer for camera stream mode
private fun initializeAnalyzer() {
val setting = MLImageSegmentationSetting.Factory() // Set whether to support fine segmentation. The value true indicates fine segmentation, and the value false indicates fast segmentation.
.setExact(false)
.setAnalyzerType(MLImageSegmentationSetting.BODY_SEG)
.setScene(MLImageSegmentationScene.FOREGROUND_ONLY)
.create()
analyzer = MLAnalyzerFactory.getInstance().getImageSegmentationAnalyzer(setting)
analyzer?.setTransactor(ImageSegmentAnalyzerTransactor(binding?.graphic ?: return))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment