input: Write a python function to capture video from a webcam and detect faces using Haar cascades.
  assert isinstance(detect_faces(), None)
output: def detect_faces():
      import cv2
  
      # Load the Haar cascade file for face detection
      face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
  
      # Capture video from webcam
      cap = cv2.VideoCapture(0)
  
      while True:
          # Read each frame
          ret, frame = cap.read()
  
          if not ret:
              break
  
          # Convert to grayscale
          gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
  
          # Detect faces
          faces = face_cascade.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30))
  
          # Draw rectangle around each face
          for (x, y, w, h) in faces:
              cv2.rectangle(frame, (x, y), (x+w, y+h), (255, 0, 0), 2)
  
          # Display the resulting frame
          cv2.imshow('Face Detection', frame)
  
          # Break the loop on 'q' key press
          if cv2.waitKey(1) & 0xFF == ord('q'):
              break
  
      # Release the capture and close windows
      cap.release()
      cv2.destroyAllWindows()