haar-loader
v0.1.0
Published
webpack2 loader to load haar cascade xml created by `opencv_traincascade`/`opencv_haartraining` as JS modules for `haar-detect` to use
Maintainers
Readme
haar-loader
Allows wepback to import haar cascade xml (as produced by opencv_traincascade) as a JS module compatible with the haar-detect package (and https://github.com/mtschirs/js-objectdetect from which it is forked). The logic for the conversion was taken from this gist.
usage
// webpack config (provided you have no other XML files)
...
module: {
rules: [
{test: /\.xml$/, use: 'haar-loader'},
...
// inline
import classifier from "haar!cascade.xml";footnotes
Webpack best practice says that loaders should do one thing only, and this kinda does two, parse XML, convert data to a classifier. Perhaps I should have used the xml-loader in a chain, but that seems excessive to require it of the users. This loader has a very specific use-case.
