Here, I have employed a combination of instance segmentation techniques and the FastSAM model. This real-time, CNN-based solution segments any object in an image using various user prompts.
Instance Segmentation with FastSAM using Ultralytics
Learn more FastSAM (Fast Segment Anything Model) - Ultralytics YOLO Docs