Skip to content

Ensure Haar cascade models are included in generated project zip#418

Open
Sarvesh-Mishra1981 wants to merge 2 commits intoJdeRobot:masterfrom
Sarvesh-Mishra1981:master_FaceDetection_Issue
Open

Ensure Haar cascade models are included in generated project zip#418
Sarvesh-Mishra1981 wants to merge 2 commits intoJdeRobot:masterfrom
Sarvesh-Mishra1981:master_FaceDetection_Issue

Conversation

@Sarvesh-Mishra1981
Copy link
Contributor

Hello @toshan-luktuke @BkPankaj,

Problem

When users clicked “Build and Download” for a project that used the FaceDetector block, the downloaded project did not work. The reason was simple: an important file called haarcascade_frontalface_default.xml was missing.

This file is needed by OpenCV to detect faces. Since it was not included in the downloaded zip file, the program crashed with an error when it tried to run face detection. Because of this, users had to manually find and add the file themselves, which was confusing and inconvenient.

Screenshot 2026-03-02 at 10 33 41 PM

Solution

To fix this issue, I updated the file-matching logic in backend/synthesis/synthesis.py. Earlier, the code was not correctly picking up the Haar cascade XML files because the file pattern was too limited. I changed the wildcard pattern so it searches properly inside all folders and subfolders.

Now, the required XML file is correctly detected and automatically added to the downloaded project.

Result

After this fix, when users download a FaceDetector project, the required XML file is included in the correct folder. The project runs smoothly without any errors, and face detection works immediately after download. This makes the overall experience much better and hassle-free for users.


Testing

View Testing Link

@Sarvesh-Mishra1981
Copy link
Contributor Author

Sarvesh-Mishra1981 commented Mar 4, 2026

@jmplaza @toshan-luktuke @BkPankaj
i am open for suggestions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant