dsgdsg sudo apt install python3-dev python3-pip python3-setuptools python3-wheel gfortran libopenblas-dev liblapack-dev -y pip3 install scipy
from ultralytics import YOLO import cv2 import winsound import time # Load pretrained YOLO model model = YOLO( "yolov8n.pt" ) # You can replace with yolov9 if needed # Animal + Human classes we want to detect TARGET_CLASSES = { 0 : "person" , 14 : "bird" , 15 : "cat" , 16 : "dog" , 17 : "horse" , 18 : "sheep" , 19 : "cow" , 20 : "elephant" , 21 : "bear" , 22 : "zebra" , 23 : "giraffe" } # Alert sound file ALERT_SOUND = "alert.wav" def play_alert (): try : winsound . PlaySound ( ALERT_SOUND , winsound . SND_FILENAME ) except : print ( "Error playing alert sound!" ) def main (): cap = cv2 .VideoCapture( 0 ) # 0 = default webcam last_alert_time = 0 while True : ...