# Is it possible to convert existing haar cascade files to the old-style for usage with Cuda?

**URL:** <https://forum.opencv.org/t/is-it-possible-to-convert-existing-haar-cascade-files-to-the-old-style-for-usage-with-cuda/19820>\
**Category:** C++\
**Tags:** haartraining, cascadeclassifier, cuda\
**Created:** [January 20, 2025, 7:10am UTC](https://forum.opencv.org/t/is-it-possible-to-convert-existing-haar-cascade-files-to-the-old-style-for-usage-with-cuda/19820 "2025-01-20T07:10:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wire\_forest](https://avatars.discourse-cdn.com/v4/letter/w/90db22/32.png) [@wire\_forest](https://forum.opencv.org/u/wire_forest)\
**Post date:** [January 20, 2025, 7:10am UTC](https://forum.opencv.org/t/is-it-possible-to-convert-existing-haar-cascade-files-to-the-old-style-for-usage-with-cuda/19820/1 "2025-01-20T07:10:14Z")

</div>

Hello,

Is it possible to convert from a “new-style” (generated by opencv\_traincascade) haar .xml file to an “old-style” (generated by opencv\_haartraining) file without having access to the training images?

For my specific use-case: I am wanting to use haarcascade\_frontalcatface.xml with the cuda version of the cascadeclassifier. I see that the cuda version of this classifier must use only the haar cascade files located under the cuda directory, and that there is no version this specific classifier in that directory. I’ve seen it mentioned that the cuda versions use the old style of .xml haar classifiers. For the differences: is this simply a matter of how the .xml files are structured, such that such a conversion could be possible–or is the floating-point data encoded in a fundamentally different way that this is not possible without the training data? I found a similar question on the [old forum](https://answers.opencv.org/question/45483/convert-new-format-haarcasccade-xml-file-to-old-format/) but it only applies if you have the training data, which in this case I do not.

---

<div class="post-metadata">

**Author:** ![wire\_forest](https://avatars.discourse-cdn.com/v4/letter/w/90db22/32.png) [@wire\_forest](https://forum.opencv.org/u/wire_forest)\
**Post date:** [January 26, 2025, 1:53am UTC](https://forum.opencv.org/t/is-it-possible-to-convert-existing-haar-cascade-files-to-the-old-style-for-usage-with-cuda/19820/3 "2025-01-26T01:53:14Z")

</div>

Thanks, makes sense.
