{ "info": { "author": "Fran\u00e7ois Leblanc", "author_email": "leblancfg@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "# autocrop\n[![Travis Build Status](https://img.shields.io/travis/leblancfg/autocrop/master.svg)](https://travis-ci.org/leblancfg/autocrop) [![AppVeyor Build Status](https://img.shields.io/appveyor/ci/leblancfg/autocrop/master.svg?label=%22Windows%22)](https://ci.appveyor.com/project/leblancfg/autocrop/branch/master) [![Codecov master](https://img.shields.io/codecov/c/github/leblancfg/autocrop/master.svg)](https://codecov.io/gh/leblancfg/autocrop) [![PyPI version](https://badge.fury.io/py/autocrop.svg)](https://badge.fury.io/py/autocrop) [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/leblancfg/autocrop/master)\n\n

\n\nPerfect for profile picture processing for your website or batch work for ID cards, autocrop will output images centered around the biggest face detected.\n\n## Use\nFrom the command line:\n\n\tusage: [-h] [-o OUTPUT] [-i INPUT] [-w WIDTH] [-H HEIGHT] [-v]\n\n\tAutomatically crops faces from batches of pictures\n\n\toptional arguments:\n\t -h, --help Show this help message and exit\n\t -o, --output, -p, --path\n\t\t\t\tFolder where cropped images will be placed.\n\t\t\t\tDefault: current working directory\n\t\t-r, --reject\n\t\t\t\tFolder where images without detected faces will be placed.\n\t\t\t\tDefault: output directory\n\t -i, --input\n\t\t\t\tFolder where images to crop are located.\n\t\t\t\tDefault: current working directory\n\t -w, --width\n\t\t\t\tWidth of cropped files in px. Default=500\n\t -H, --height\n\t\t\t\tHeight of cropped files in px. Default=500\n\t --facePercent Percentage of Face height to image height (zoom factor)\n\t --padUp Padding up value compared to padDown. Default=50\n\t --padDown Padding down value compared to padDown. Default=50\n\t --padLeft Padding left value compared to padRight. Default=50\n\t --padRight Padding right value compared to padLeft. Default=50\n\t -v, --version Show program's version number and exit\n\n\nParams (width, height, facePercent)\n* Example:\n`autocrop -i pics -o crop -w 400 -H 400 --facePercent 50`.\n* Example with reject folder:\n`autocrop -i pics -o crop -r nofaces -w 400 -H 400 --facePercent 50`.\n* Example more padding down:\n `autocrop -i pics -o crop -w 400 -H 400 --facePercent 50 --padUp 20 --padDown 50`.\n\n### What it does\nThe previous command will:\n1. Copy all images found in the top level of `pics` to `crop`,\n2. Crop around the face and resize to 400x400 pixels all images in `crop`.\n\nImages where a face can't be detected will be left in `crop`.\nIf no output folder is added, asks for confirmation and destructively crops images in-place.\n\n### Supported file types\n\nThe following file types are supported:\n\n- EPS files (`.eps`)\n- GIF files (`.gif`) (only the first frame of an animated GIF is used)\n- JPEG 2000 files (`.j2k`, `.j2p`, `.jp2`, `.jpx`)\n- JPEG files (`.jpeg`, `.jpg`, `.jpe`)\n- LabEye IM files (`.im`)\n- macOS ICNS files (`.icns`)\n- Microsoft Paint bitmap files (`.msp`)\n- MSP files (`.msp`)\n- MSP files (`.msp`)\n- PCX files (`.pcx`)\n- Portable Network Graphics (`.png`)\n- Portable Pixmap files (`.pbm`, `.pgm`, `.ppm`)\n- SGI files (`.sgi`)\n- SPIDER files (`.spi`)\n- TGA files (`.tga`)\n- TIFF files (`.tif`, `.tiff`)\n- WebP (`.webp`)\n- Windows bitmap files (`.bmp`, `.dib`)\n- Windows ICO files (`.ico`)\n- X bitmap files (`.xbm`)\n\n## Installation\nSimple! In your command line, type:\n\n~~~python\npip install autocrop\n~~~\n\n### Gotchas\nAutocrop uses OpenCV to perform face detection, which is installed through binary [wheels](http://pythonwheels.com/). If you *already* have OpenCV 3+ installed, you may wish to uninstall the additional OpenCV installation: `pip uninstall opencv-python`.\n\n### Installing directly\nIn some cases, you may wish the package directly, instead of through [PyPI](https://pypi.python.org/pypi):\n\n~~~\ncd ~\ngit clone https://github.com/leblancfg/autocrop\ncd autocrop\npip install .\n~~~\n\n### conda\nDevelopment of a `conda-forge` package for the [Anaconda Python distribution](https://www.anaconda.com/download/) is also currently slated for development. Please leave feedback on [issue #7](https://github.com/leblancfg/autocrop/issues/7) if you are insterested in helping out.\n\n## Requirements\nBest practice for your projects is of course to [use virtual environments](http://docs.python-guide.org/en/latest/dev/virtualenvs/). At the very least, you will need to [have pip installed](https://pip.pypa.io/en/stable/installing/).\n\nAutocrop is currently being tested on:\n* Python:\n - 2.7\n - 3.4\n - 3.5\n - 3.6\n* OS:\n - Linux\n - macOS\n - Windows\n\n## More Info\nCheck out:\n* http://docs.opencv.org/master/d7/d8b/tutorial_py_face_detection.html#gsc.tab=0\n* http://docs.opencv.org/master/d5/daf/tutorial_py_histogram_equalization.html#gsc.tab=0\n\nAdapted from:\n* http://photo.stackexchange.com/questions/60411/how-can-i-batch-crop-based-on-face-location\n\n## Contributing\n\nAlthough autocrop is essentially a CLI wrapper around a single OpenCV function, it is actively developed. It has active users throughout the world.\n\nIf you would like to contribute, please consult the [contribution docs](CONTRIBUTING.md).", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/leblancfg/autocrop", "keywords": "", "license": "BSD 2-Clause", "maintainer": "", "maintainer_email": "", "name": "autocrop", "package_url": "https://pypi.org/project/autocrop/", "platform": "", "project_url": "https://pypi.org/project/autocrop/", "project_urls": { "Homepage": "https://github.com/leblancfg/autocrop" }, "release_url": "https://pypi.org/project/autocrop/0.3.5/", "requires_dist": null, "requires_python": "", "summary": "Automatically crops faces from batches of pictures", "version": "0.3.5" }, "last_serial": 5512831, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "91c6245ac45756a31893ab46ef2e559a", "sha256": "824986b2136c07ad870b330f4a923e915cb9f56bbaba55db0ef2250bed9a81d8" }, "downloads": -1, "filename": "autocrop-0.1.1.tar.gz", "has_sig": false, "md5_digest": "91c6245ac45756a31893ab46ef2e559a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 142596, "upload_time": "2017-09-28T14:37:33", "url": "https://files.pythonhosted.org/packages/dd/47/7936c3f2454e3acbd413eea0efc2029788e62389de6cc23818599592e0ea/autocrop-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "348a901d551b699bf79135a65468e433", "sha256": "9eacc2a71a55027cda8a9a35ef6e93ab7c15f27642367d13c310712b9dc1c8ed" }, "downloads": -1, "filename": "autocrop-0.1.2.tar.gz", "has_sig": false, "md5_digest": "348a901d551b699bf79135a65468e433", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 141883, "upload_time": "2017-09-28T17:53:55", "url": "https://files.pythonhosted.org/packages/78/93/4f3a12329e0b403a3308719148cc4161b5aa68433da1691a773d3fb5444b/autocrop-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "a6c10c4e89a3e2382b031542a572d185", "sha256": "7a25328d51644ce4ea2771ca79ea931d9bca6016f40f9a9c6489b6219e00ea73" }, "downloads": -1, "filename": "autocrop-0.1.3.tar.gz", "has_sig": false, "md5_digest": "a6c10c4e89a3e2382b031542a572d185", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 141146, "upload_time": "2017-09-29T20:41:05", "url": "https://files.pythonhosted.org/packages/3b/e2/a19004af189c80296fdd0994846988013c2c96e690b4addaafcad32a884d/autocrop-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "fe4286e7d130db0085e2f022723d87b0", "sha256": "e00a0e7d6ed658a1e888924d67b298ecdd1db9fd64896e9a63cd5a8af2e4faa7" }, "downloads": -1, "filename": "autocrop-0.1.4.tar.gz", "has_sig": false, "md5_digest": "fe4286e7d130db0085e2f022723d87b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 141164, "upload_time": "2017-10-02T12:51:05", "url": "https://files.pythonhosted.org/packages/56/69/b689caacc8ea0d4338b9b7de3feaddbc264d87166a1b021a4eeec3d8e8a3/autocrop-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "0edeaa768047452d27fbcfe9a313b25a", "sha256": "862d0edfef4e1ef591fded06899678c7399694928b31e5f6a1a9875c8a9b2172" }, "downloads": -1, "filename": "autocrop-0.1.5.tar.gz", "has_sig": false, "md5_digest": "0edeaa768047452d27fbcfe9a313b25a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 141243, "upload_time": "2017-10-03T20:33:26", "url": "https://files.pythonhosted.org/packages/b8/5b/2fe033c1231afa757fde4a753c00f863ee040f0a5c07a5048685736cdfb7/autocrop-0.1.5.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "199696169564e36c89a8e48d33d9635c", "sha256": "3330ccc21c30c5ae2e82378c2c17a7553c0e17dfa4b9fde42dc9e6dddb61661d" }, "downloads": -1, "filename": "autocrop-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "199696169564e36c89a8e48d33d9635c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 146389, "upload_time": "2018-01-24T22:17:54", "url": "https://files.pythonhosted.org/packages/fb/86/a40f485d442716ddc09e686c83a0aaf9ad8e45566d3f0f926bc47e4bafa5/autocrop-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aa95e9a6761e9a438420f6cc10cbe4e7", "sha256": "c69d00b02048fc645ba2af2f032a5a8c147e7c30eeb798c394ffd32e95e4adff" }, "downloads": -1, "filename": "autocrop-0.2.0.tar.gz", "has_sig": false, "md5_digest": "aa95e9a6761e9a438420f6cc10cbe4e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9339192, "upload_time": "2018-01-24T22:17:57", "url": "https://files.pythonhosted.org/packages/31/dd/bd2226ff112129b2e1c795e9b711ad3fea6bf949d8b933175e9d2402b51f/autocrop-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "2b0207a81d08b45fa1336efeec9a42ee", "sha256": "0c7fb4f1c922b5d999fb1dd097dcaf56cee990ea2ab8041d301bc06768a43fcd" }, "downloads": -1, "filename": "autocrop-0.3.0.tar.gz", "has_sig": false, "md5_digest": "2b0207a81d08b45fa1336efeec9a42ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9339944, "upload_time": "2018-08-18T00:15:42", "url": "https://files.pythonhosted.org/packages/26/e9/b4a654fb5f6c279e6023198e1b5fe5695771f9d4362d27f5572a4063e90e/autocrop-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "cb930e175cfabc1aa59fbbfd3a54227c", "sha256": "865906fe7b98708633d26db1c470b7f3cc55441e9c931f4a912fe7adecdccf40" }, "downloads": -1, "filename": "autocrop-0.3.1.tar.gz", "has_sig": false, "md5_digest": "cb930e175cfabc1aa59fbbfd3a54227c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 155818, "upload_time": "2019-01-15T16:07:17", "url": "https://files.pythonhosted.org/packages/b0/b5/691010a64275421717d037cf3c3c22df8ec7c26e8641a5e01d9443e4e4f4/autocrop-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "e3b76524efeeb17f4dc23199e762882e", "sha256": "b16d04e0d6a51a330bd813e2914d3eb1ebe2f688b82343b64fceffbea4024e02" }, "downloads": -1, "filename": "autocrop-0.3.2.tar.gz", "has_sig": false, "md5_digest": "e3b76524efeeb17f4dc23199e762882e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 158874, "upload_time": "2019-07-09T14:33:58", "url": "https://files.pythonhosted.org/packages/32/44/0d6f47ceeaaf4b5cd53d88e071a3de653848e29df5da38b406635a0fb350/autocrop-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "37b9f5066a1aad3415cb839c49e82d5d", "sha256": "fc6987468143895c5362e75a1afc74dcf5f52365b9ef3c18a48c494f55597c23" }, "downloads": -1, "filename": "autocrop-0.3.3.tar.gz", "has_sig": false, "md5_digest": "37b9f5066a1aad3415cb839c49e82d5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 157345, "upload_time": "2019-07-10T15:30:49", "url": "https://files.pythonhosted.org/packages/20/cb/b0682dd23d106e78085a8faf81b85c1fa4e527e0a7526193aef3f798ead2/autocrop-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "1a95bd67ee84db735730d7a3deda563e", "sha256": "43a4cc100b5afb2345b93e1dffe732a3ca1352917ce09a3f068793062d8cbca3" }, "downloads": -1, "filename": "autocrop-0.3.4.tar.gz", "has_sig": false, "md5_digest": "1a95bd67ee84db735730d7a3deda563e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 157389, "upload_time": "2019-07-10T15:40:48", "url": "https://files.pythonhosted.org/packages/59/32/47794a8a94e9565179e4f892354aa398566666b55f447cef8e4eed840a0b/autocrop-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "7005d7cc72bf5bd2b1f2deff8d986b2c", "sha256": "e0a699eb1bca601f6b3b5b63ad96615ee96ceedc4efa835efe988e212b8f8f6b" }, "downloads": -1, "filename": "autocrop-0.3.5.tar.gz", "has_sig": false, "md5_digest": "7005d7cc72bf5bd2b1f2deff8d986b2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 157342, "upload_time": "2019-07-10T15:59:50", "url": "https://files.pythonhosted.org/packages/72/b0/938ed7949cf75eaf34739109973f17f101a72c581c9bae1eb5366f0320c6/autocrop-0.3.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7005d7cc72bf5bd2b1f2deff8d986b2c", "sha256": "e0a699eb1bca601f6b3b5b63ad96615ee96ceedc4efa835efe988e212b8f8f6b" }, "downloads": -1, "filename": "autocrop-0.3.5.tar.gz", "has_sig": false, "md5_digest": "7005d7cc72bf5bd2b1f2deff8d986b2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 157342, "upload_time": "2019-07-10T15:59:50", "url": "https://files.pythonhosted.org/packages/72/b0/938ed7949cf75eaf34739109973f17f101a72c581c9bae1eb5366f0320c6/autocrop-0.3.5.tar.gz" } ] }