- Install:
!pip install ultralytics
!pip install git+https://github.com/facebookresearch/segment-anything.git
!wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_l_0b3195.pth
- Run the command:
!python SAM_yolov8.py --img image_path --weights yolov8 weights --model_type SAM model type --checkpoints SAM model checkpoints
Example:
!python SAM_yolov8.py --img '/content/pexels-erick-15590648.jpg' --weights '/content/best.pt' --model_type 'vit_l' --checkpoints '/content/sam_vit_l_0b3195.pth'
- Output:
yoloV8
- Reference: