79291993

Date: 2024-12-18 17:36:05
Score: 2
Natty:
Report link
import cv2
from ultralytics import YOLO
import torch

model = YOLO('seg.pt')


img = cv2.imread('ballon2.jpg')
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)

results = model.predict(img, show = True)

cv2.imshow('seg',(results[0].masks.data[0].numpy() * 255).astype("uint8"))

the last line is our answer.

enter image description here

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: SerifDogru