Python, Yolo8, OpenCV, numpy
To use on Colab add !pip install ultralytics
To use with Anaconda nothing to add, comment and uncomment what is needed.
See result below.
Many thanks for class YOLOSegmentation and very clear explanations to Pysource channel. link to Youtube