lbpcascade_animeface icon indicating copy to clipboard operation
lbpcascade_animeface copied to clipboard

Feature/package

Open rachmadaniHaryono opened this issue 5 years ago • 2 comments

with this pr lbpcascade_animeface can be uploaded to pypi and can be used on other program as package

  • it also include change to detect.py to make it more modular so other program can use it as library
  • no license here yet, i recommend @nagadomi choose one. if you don't know try this https://choosealicense.com/
  • i include the xml data in this. packager have to put it on root dir, so it can be included on package
  • related above, there should be a better way to include xml data and use it in program. this temporarily fixed by adding parameter for cascade file
  • maybe organize a subcommand. this current command can be moved to detect subcommand and other example like on #1 can be added to another subcommand like crop

rachmadaniHaryono avatar Nov 17 '18 23:11 rachmadaniHaryono

The license is described in the XML file. It is MIT license. I do not consider examples/detect.py as a cli tool. I think that it probably will not be used. However it may be useful to be able to get the XML path from a module.

like:

import lbpcascade_animeface
cascade = cv2.CascadeClassifier(lbpcascade_animeface.XML_PATH)

nagadomi avatar Nov 23 '18 03:11 nagadomi

i just made it as you ask, the constant can be used as above (from lbpcascade_animeface import XML_PATH).

as example if you install on virtual env, virtualenv root = /home/q/envs, virtualenv name = temp it will be

'/home/<username>/envs/temp/lib/python3.6/site-packages/lbpcascade_animeface/lbpcascade_animeface.xml'

to try it:

  • create distribution file from this pr (python setup.py sdist)
  • create virtualenv on empty file
  • pip install from distribution file
  • open python console
  • import lbpcascade_animeface as la; print(la.XML_PATH)

rachmadaniHaryono avatar Nov 23 '18 05:11 rachmadaniHaryono