run cascade file openmv3 automatically disconnects from IDE

Hello,every one! when I loaded my cascade file from generated,the openmv3 cam disconnects from IDE.How to solve this issue?Thanks!The source as follow:

# Face Detection Example
# This example shows off the built-in face detection feature of the OpenMV Cam.
# Face detection works by using the Haar Cascade feature detector on an image. A
# Haar Cascade is a series of simple area contrasts checks. For the built-in
# frontalface detector there are 25 stages of checks with each stage having
# hundreds of checks a piece. Haar Cascades run fast because later stages are
# only evaluated if previous stages pass. Additionally, your OpenMV Cam uses
# a data structure called the integral image to quickly execute each area
# contrast check in constant time (the reason for feature detection being
# grayscale only is because of the space requirment for the integral image).

import sensor, time, image

# Reset sensor

# Sensor settings
# HQVGA and GRAYSCALE are the best for face tracking.

# Load Haar Cascade
# By default this will use all stages, lower satges is faster but less accurate.
face_cascade = image.HaarCascade("/pick.cascade")

# FPS clock
clock = time.clock()

while (True):

    # Capture snapshot
    img = sensor.snapshot()

    # Find objects.
    # Note: Lower scale factor scales-down the image more and detects smaller objects.
    # Higher threshold results in a higher detection rate, with more false positives.
    objects = img.find_features(face_cascade, threshold=0.75, scale_factor=1.25)
    # Draw objects
    for r in objects:

    # Print FPS.
    # Note: Actual FPS is higher, streaming the FB makes it slower.

Attach the xml file and cascade file (5.26 KB)

I had copied the file again and then eject (or safe remove) the drive, reset the cam and then try to run the script again
with the firmware 2.6.0 and firmware 2.7.0, but all failed.

Ibrahim, any thoughts?

Anyway, can you post the algorithm in the mean time?

Hi, kwagyeman.
Sorry,I can’t undestand which algorithm you mean? Is it the first post of mine?

Sorry, was reading this on my phone. I see that you posted the cascade with issues.

I have found a solution and a new issue.
Running on Ubuntu. The size of the cascade file generated on Ubuntu is different from the one generated on Windows10.

New issue:
After using the solution, it detects nothing and “objects” is always null.

Firmware Version:2.7.0 (1 KB)

Hi, the cascade generator doesn’t work on Windows, we’ll add it to the IDE at some point. If you got it working and it detects nothing, try changing the threshold and/or scale factor.

OK! Thank you very much!