Sunday, April 27, 2025
Anti_Sleeping_project_AI
Saturday, April 19, 2025
Face_Recognition_AI_Sunil
import cv2
# Load Haar cascade classifiers from OpenCV's default location
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_eye.xml')
# Verify if files loaded correctly
if face_cascade.empty():
print("Error: Face cascade file not loaded! Check the file path.")
if eye_cascade.empty():
print("Error: Eye cascade file not loaded! Check the file path.")
cap = cv2.VideoCapture(0)
while True:
ret, img = cap.read()
if not ret:
print("Failed to grab frame")
break
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray, 1.3, 5)
for (x, y, w, h) in faces:
cv2.rectangle(img, (x, y), (x + w, y + h), (255, 255, 0), 2)
roi_gray = gray[y:y+h, x:x+w]
roi_color = img[y:y+h, x:x+w]
eyes = eye_cascade.detectMultiScale(roi_gray)
for (ex, ey, ew, eh) in eyes:
cv2.rectangle(roi_color, (ex, ey), (ex+ew, ey+eh), (0, 127, 255), 2)
cv2.imshow('Face & Eye Detection', img)
if cv2.waitKey(30) & 0xFF == 27: # Press 'ESC' to exit
break
cap.release()
cv2.destroyAllWindows()
Saturday, April 5, 2025
Google Teachable Machine Interfacing to the Arduino
1. https://youtu.be/0VEDiWr_wdU?si=ypsXcY-oNjulJMxt (Chinese)
2.https://youtu.be/ARR3YWnTf-o?si=dI1MjIjuxnXIpXNO (Hand gesture control bot - Google teachable machine)
3. https://youtu.be/Xm4ymozAG34?si=ILx2-yLnkPi-iHoO (Face recognition AI)
4. https://youtu.be/EJrmlhk0A2o?si=HI73ZLB46VUfcxmB (Voice operated car)
5. https://youtu.be/OP7c3swgpCs?si=9m8spfV40UqRw5Yn ( Mask Detection project)
MUD Three Mode operation Manual Automatic GPS
Code for three mode operation: /* 3-Mode Headlight Controller - Manual mode (driver uses a toggle to pick high/low) - Auto mode (LDR...
-
// HTML CODE: <! DOCTYPE html > < html > < head > < title > Gunshot Detection - Teachable Machine </ title ...
-
// SERVO ROTATING MULTIPLE TIME <! DOCTYPE html > < html lang = "en" > < head > < meta charset = ...
-
1. RC522 RFID Reader to Arduino Uno: RC522 Pin Arduino Uno Pin Description SDA D10 Slave Select (SS) for SPI SCK D13 SPI Clock MOSI D11 ...