Haar Cascade not detecting any face or boundaries

Hi, I am trying to detect face and eyes using the haar inbuilt by OpenMV but i keep getting no face detected and also, the boundary regions defined are not shown. Am i doing anything wrong? Working with arduino Nicla vision board

import sensor, image, time, tf

Initialize camera sensor

sensor.skip_frames(time=2000) # Let the camera adjust

Load TensorFlow Lite model

net = tf.load(“model.tflite”)

Initialize face and eye detection

face_cascade = image.HaarCascade(“frontalface”, stages=25)
eye_cascade = image.HaarCascade(“eye”, stages=25)

while True:
img = sensor.snapshot()

# Perform face detection
faces = img.find_features(face_cascade, threshold=0.5, scale_factor=1.1)

# Check if any faces are detected
if faces:
    print(f"Faces detected: {len(faces)}")
    print("No faces detected")

for face in faces:
    # Draw rectangle around detected face

    # Perform eye detection within the detected face region
    eyes = img.find_features(eye_cascade, roi=face, threshold=0.5, scale_factor=1.1)
    # Check if any eyes are detected within the face region
    if eyes:
        print(f"Eyes detected: {len(eyes)} in face region")
        print("No eyes detected in face region")

    for eye in eyes:
        # Draw rectangle around detected eye

        # Extract and preprocess the eye region for TensorFlow Lite model
        eye_roi = img.copy(roi=eye).to_grayscale()  # Convert to grayscale
        eye_roi = eye_roi.resize(24, 24)  # Resize to match model input size
        eye_array = eye_roi.to_bytes()

        # Perform inference using TensorFlow Lite model
        output = net.classify(eye_array)[0].output()  # Get output probabilities

        # Print the raw output of the model for debugging
        print("Model output:", output)

        # Determine if eye is open or closed based on model output
        prediction = output.index(max(output))

        # Print the prediction label
        label = "Closed" if prediction == 0 else "Open"
        print("Eye prediction:", label)

Please do not spam the same post in multiple places.