Convert .xml to .cascade

Where is your algorithm for binary haar cascade converter located? The old link for that seems to be broken.

Hi, things got moved around:

Ok, I got it.
Now I am trying to open my xml with it, however it will always create a blank file. Is this the right way to use it?


  1. If you need to train a new cascade, follow OpenCV tutorials to train a haar cascade:

  • Note you have to use -baseFormatSave to save the cascade in the old format
  1. Convert the xml cascade to binary using the converter script:
python2 my_cascade.xml
  1. Copy my_cascade.cascade to camera storage (flash or SD) and run the example script.

I was training it with the new format, so now I have them in the correct base format.
Now instead of creating a blank file, when I open my xml with the converter script, no file is generated whatsoever.
What should I do?

(I am sending the xml if that helps)
cascade.xml (46.7 KB)

Please run the following command from the command line on Linux:

python2 cascade.xml


can we use this file ( with python 3.6?

Do you have another way to convert the xml file?


I can only confirm it works with Python2, and no it’s the only tool we have to convert cascades, sorry.