Skip to content

Instantly share code, notes, and snippets.

@hsiaoer
Created June 24, 2019 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hsiaoer/407c8be5a4c26911d2b0113ef1e7a7c9 to your computer and use it in GitHub Desktop.
Save hsiaoer/407c8be5a4c26911d2b0113ef1e7a7c9 to your computer and use it in GitHub Desktop.
private lazy var visionModel = FritzVisionSkySegmentationModel()
/// ...
func createSticker(_ image: UIImage) {
/// Use the result to build a mask
guard let result = try? visionModel.predict(fritzImage),
let mask = result.buildSingleClassMask(
forClass: FritzVisionSkyClass.none,
clippingScoresAbove: clippingScoresAbove,
zeroingScoresBelow: zeroingScoresBelow
)
else { return }
/// Display the mask...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment