# FaceCropThumb
FaceCropThumb is a Python package for generating thumbnails of detected faces in images. It utilizes the MTCNN (Multi-Task Cascaded Convolutional Neural Network) for accurate face detection and OpenCV for image processing.
All documentation is in the “docs” directory and online at https://facecrop-thumb.readthedocs.io/en/stable/. If you’re just getting started, here’s how we recommend you read the docs:
## Features
- Detect faces in images using the MTCNN model
- Crop detected faces with a configurable margin
- Generate square thumbnails of detected faces
- Option to resize the entire image if no face is detected or face detection is skipped
- Command-line utility for easy usage
## Quick Installation
You can install FaceCropThumb via pip:
```pip install facecropthumb```
## Quick Usage
```facecropthumb <image_path> [-d/--dir <output_directory>] [-m/--margin <margin_size>] [-F/--no-face] [-S/--skip-face] [-a/--all]```
- `<image_path>`: Path to the input image file.
- `-d/--dir <output_directory>`: Directory to store the output thumbnail. Default is the current directory.
- `-m/--margin <margin_size>`: Margin around the detected face. Default is 50 pixels.
- `-F/--no-face`: Skip face detection and resize the whole image if no face is detected.
- `-S/--skip-face`: Skip face detection and resize the whole image.
- `-a/--all`: Process all images in the specified directory. If no directory is provided, it processes images in the current directory.
- `-v/--version`: Show installed version.
- `-h/--help`: Show help.
Example:
```facecropthumb input_image.jpg -d output_directory -m 30 -F```
This command will generate a thumbnail of the detected face in `input_image.jpg`, with a margin of 30 pixels, and if no face is detected, it will resize the whole image to a square of 74 x Y pixels (~approx).
## Development Documentation
DISCLAIMER: This documentation is for the contributers of FaceCropThumb, not for general package users.
Firstly install dev dependencies from `requirements.txt` file
### Usage
To run and test the package, use `python -m facecrop-thumb <args>`
### Build Docs
You can see the production build docs in `docs/build/index.html`
Update the documentation at any cost after any change in feature
Run this to watch the `docs/` folder while you're making documentation changes
`watchmedo shell-command --patterns="*.rst;conf.py;_templates/*" --recursive --command='sphinx-build -b html docs docs/_build' docs`
### Release
After a successful change in the package, it's time to publish it officially.
- Update the version in `facecrop_thumb/version.py`
- Create a new release on [release page](https://github.com/mr-vaibh/facecrop-thumb/releases/new). (This will automatically trigger GitHub actions to release a new version on PYPI)
That's it, the newer version will be available to everyone.
But if you want to publish a version by yourself, you can use following command:
- `python setup.py sdist`
- ` twine upload dist/*`
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": "https://facecrop-thumb.readthedocs.io/en/stable/",
"name": "facecrop-thumb",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "face detection thumbnail image-processing",
"author": "Vaibhav Shukla",
"author_email": "shuklavaibhav336@example.com",
"download_url": "https://files.pythonhosted.org/packages/17/5b/3129ad4f149741920fe8a8b8e2995fcb103ad5160ace3b84fb29f4b5d1c2/facecrop-thumb-1.0.6.tar.gz",
"platform": null,
"description": "# FaceCropThumb\r\n\r\nFaceCropThumb is a Python package for generating thumbnails of detected faces in images. It utilizes the MTCNN (Multi-Task Cascaded Convolutional Neural Network) for accurate face detection and OpenCV for image processing.\r\n\r\nAll documentation is in the \u201cdocs\u201d directory and online at https://facecrop-thumb.readthedocs.io/en/stable/. If you\u2019re just getting started, here\u2019s how we recommend you read the docs:\r\n\r\n## Features\r\n\r\n- Detect faces in images using the MTCNN model\r\n- Crop detected faces with a configurable margin\r\n- Generate square thumbnails of detected faces\r\n- Option to resize the entire image if no face is detected or face detection is skipped\r\n- Command-line utility for easy usage\r\n\r\n## Quick Installation\r\n\r\nYou can install FaceCropThumb via pip:\r\n\r\n```pip install facecropthumb```\r\n\r\n## Quick Usage\r\n\r\n```facecropthumb <image_path> [-d/--dir <output_directory>] [-m/--margin <margin_size>] [-F/--no-face] [-S/--skip-face] [-a/--all]```\r\n\r\n- `<image_path>`: Path to the input image file.\r\n- `-d/--dir <output_directory>`: Directory to store the output thumbnail. Default is the current directory.\r\n- `-m/--margin <margin_size>`: Margin around the detected face. Default is 50 pixels.\r\n- `-F/--no-face`: Skip face detection and resize the whole image if no face is detected.\r\n- `-S/--skip-face`: Skip face detection and resize the whole image.\r\n- `-a/--all`: Process all images in the specified directory. If no directory is provided, it processes images in the current directory.\r\n- `-v/--version`: Show installed version.\r\n- `-h/--help`: Show help.\r\n\r\nExample:\r\n\r\n```facecropthumb input_image.jpg -d output_directory -m 30 -F```\r\n\r\nThis command will generate a thumbnail of the detected face in `input_image.jpg`, with a margin of 30 pixels, and if no face is detected, it will resize the whole image to a square of 74 x Y pixels (~approx).\r\n\r\n## Development Documentation\r\n\r\nDISCLAIMER: This documentation is for the contributers of FaceCropThumb, not for general package users.\r\n\r\nFirstly install dev dependencies from `requirements.txt` file\r\n\r\n### Usage\r\n\r\nTo run and test the package, use `python -m facecrop-thumb <args>`\r\n\r\n### Build Docs\r\n\r\nYou can see the production build docs in `docs/build/index.html`\r\n\r\nUpdate the documentation at any cost after any change in feature\r\n\r\nRun this to watch the `docs/` folder while you're making documentation changes\r\n\r\n`watchmedo shell-command --patterns=\"*.rst;conf.py;_templates/*\" --recursive --command='sphinx-build -b html docs docs/_build' docs`\r\n\r\n### Release\r\n\r\nAfter a successful change in the package, it's time to publish it officially.\r\n\r\n - Update the version in `facecrop_thumb/version.py`\r\n\r\n - Create a new release on [release page](https://github.com/mr-vaibh/facecrop-thumb/releases/new). (This will automatically trigger GitHub actions to release a new version on PYPI)\r\n\r\nThat's it, the newer version will be available to everyone.\r\n\r\nBut if you want to publish a version by yourself, you can use following command:\r\n\r\n - `python setup.py sdist`\r\n\r\n - ` twine upload dist/*`\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Generate thumbnails of detected faces in images using Python.",
"version": "1.0.6",
"project_urls": {
"Documentation": "https://facecrop-thumb.readthedocs.io/en/stable/",
"Funding": "https://www.buymeacoffee.com/mrvaibh",
"Homepage": "https://facecrop-thumb.readthedocs.io/en/stable/",
"Release Notes": "https://github.com/mr-vaibh/facecrop-thumb/releases",
"Source": "https://github.com/mr-vaibh/facecrop-thumb",
"Tracker": "https://github.com/mr-vaibh/facecrop-thumb/issues"
},
"split_keywords": [
"face",
"detection",
"thumbnail",
"image-processing"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "175b3129ad4f149741920fe8a8b8e2995fcb103ad5160ace3b84fb29f4b5d1c2",
"md5": "4878d42ed98e4b219f93b8c496ceb8ac",
"sha256": "92b90ece45838a37329b453661e903650538070a1b196682e45ab2f830b68ee3"
},
"downloads": -1,
"filename": "facecrop-thumb-1.0.6.tar.gz",
"has_sig": false,
"md5_digest": "4878d42ed98e4b219f93b8c496ceb8ac",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5551,
"upload_time": "2024-04-15T06:26:03",
"upload_time_iso_8601": "2024-04-15T06:26:03.209681Z",
"url": "https://files.pythonhosted.org/packages/17/5b/3129ad4f149741920fe8a8b8e2995fcb103ad5160ace3b84fb29f4b5d1c2/facecrop-thumb-1.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-15 06:26:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mr-vaibh",
"github_project": "facecrop-thumb",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "twine",
"specs": []
},
{
"name": "sphinx",
"specs": []
}
],
"lcname": "facecrop-thumb"
}