Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

haar-loader

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

haar-loader

webpack2 loader to load haar cascade xml created by `opencv_traincascade`/`opencv_haartraining` as JS modules for `haar-detect` to use

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

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.

Keywords

webpack

FAQs

Package last updated on 03 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts