ChaoningZhang / MobileSAM

This is the official code for MobileSAM project that makes SAM lightweight for mobile applications and beyond!
Apache License 2.0
4.86k stars 505 forks source link

Hello professor, how can I generate overlay images corresponding to the mask and the original image? #116

Open zaoyueri opened 1 year ago

zaoyueri commented 1 year ago

Hello professor, how can I generate overlay images corresponding to the mask and the original image?

John-Reddon commented 9 months ago

Hi! The predict function should give you a mask (a boolean array). Convert it in np.uint8 array, then use the function ```cv2.addWeight function in order to combine the original image and the mask.

Hope this helped