Closed sidan5 closed 6 months ago
Issue #8 led to #10. @Ezaldeen99 merged pull request, but didn't update the example. These changes were meant to make optional unwrapping safer. The only missing parts in the example are the do
, try
, and catch
statements. Replace them with the following code:
let image = UIImage(named: "child")
inputImage.image = image
let backgroundRemoval = BackgroundRemoval()
do {
outputImage.image = try backgroundRemoval.removeBackground(image: image!)
segmentedImage.image = try backgroundRemoval.removeBackground(image: image!, maskOnly: true)
} catch {
print(error)
}