tucan9389 / SemanticSegmentation-CoreML

The example project of inferencing Semantic Segementation using Core ML
https://github.com/motlabs/awesome-ml-demos-with-ios
MIT License
320 stars 32 forks source link

Extract Image #4

Closed ismailismail closed 4 years ago

ismailismail commented 4 years ago

is there any way to extract image from segmentation map or how to convert MLMultiArray to image?

tucan9389 commented 4 years ago

I haven't implemented yet, but you can save the image file with the following step.

  1. draw on UIView with MLMultiArray (like my implement)
  2. save the UIView as an image (https://stackoverflow.com/a/17145149/4160632)

If you have any questions, please tell me.

ismailismail commented 4 years ago

thanks for fast response I attached two image that shows your step. I want to cut the cat on the image. is it possible? Screenshot 2019-11-26 13 32 35 Screenshot 2019-11-26 13 32 41

tucan9389 commented 4 years ago

Hmm, 🤔 You can make a masked image. (The following step is just to guess, I didn’t try it)

  1. Create a mask image with the segmentation map
  2. Create a masked image with the original image and mask image (Original image + mask image -> masked image)

The following link would be helped. https://stackoverflow.com/questions/5757386/how-can-i-mask-a-uiimageview

tucan9389 commented 4 years ago

@ismailismail

Did you implement the post-processing? If you can, PR to this repo with new tab bar item!

Thanks