from ultralytics import YOLO
import pyautogui
import cv2,time
import numpy as np
time.sleep(5)
# Load the model
model = YOLO('yolo11n.pt', task='detect')
# Set the confidence threshold
conf_threshold = 0.4
# Capture the entire screen
screen_image = pyautogui.screenshot()
screen_image = cv2.cvtColor(np.array(screen_image), cv2.COLOR_BGR2RGB)
# Perform object detection on the captured screen image
results = model(screen_image, show=True)
time.sleep(3)