Name | crop-yolo-v8 JSON |
Version |
1.1.1
JSON |
| download |
home_page | None |
Summary | put yolov8m/n/x.pt in ~/.yolov8 and run |
upload_time | 2024-07-21 23:48:49 |
maintainer | None |
docs_url | None |
author | tadeasf |
requires_python | <4.0,>=3.12 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# YOLOv8 Person Cropping Tool
This tool uses YOLOv8 to detect and crop persons from images. It's designed to process multiple images, optionally searching recursively through directories, and can crop either the largest detected person or all detected persons in each image.
## Features
- Uses YOLOv8 for accurate person detection
- Supports multiple YOLOv8 models (yolov8x.pt, yolov8m.pt, yolov8s.pt)
- Processes images in parallel for faster execution
- Allows recursive directory search
- Option to crop all detected persons or just the largest one
- Adds customizable margin to cropped images
- Saves images with no detected persons in a separate directory
- Option to remove small images after processing
## Installation
1. Clone this repository
2. Install the required dependencies:
```bash
pip install ultralytics rich typer opencv-python
```
3. Ensure you have the YOLOv8 models in your home directory under a `yolov8` folder.
## Usage
Run the script using the following command:
```bash
python main.py [OPTIONS]
```
### Options
- `--margin-percentage INTEGER`: Margin percentage for bounding box (default: 3, recommended range: 0-10)
- `--model-size INTEGER`: Model size (default: 640, recommended: 320, 640, or 1280)
- `--model TEXT`: YOLOv8 model to use (options: yolov8x.pt, yolov8m.pt, yolov8s.pt)
- `--recursive / --no-recursive`: Search for images recursively (default: False)
- `--crop-all / --no-crop-all`: Crop all detected persons instead of just the largest (default: False)
## How it works
1. The script prompts you to select an input directory.
2. It processes all images in the selected directory (and subdirectories if recursive option is enabled).
3. Detected persons are cropped from the images with the specified margin.
4. Cropped images are saved in a 'cropped' subdirectory within the input directory.
5. Images with no detected persons are saved in a 'no-person' subdirectory.
6. After processing, you have the option to remove small images based on a size threshold.
Raw data
{
"_id": null,
"home_page": null,
"name": "crop-yolo-v8",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": null,
"author": "tadeasf",
"author_email": "taddy.fort@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e5/61/e3d8d7ddfbc67888c4a5adc79dc720edd434a113be3b649110ec0eca44fc/crop_yolo_v8-1.1.1.tar.gz",
"platform": null,
"description": "# YOLOv8 Person Cropping Tool\n\nThis tool uses YOLOv8 to detect and crop persons from images. It's designed to process multiple images, optionally searching recursively through directories, and can crop either the largest detected person or all detected persons in each image.\n\n## Features\n\n- Uses YOLOv8 for accurate person detection\n- Supports multiple YOLOv8 models (yolov8x.pt, yolov8m.pt, yolov8s.pt)\n- Processes images in parallel for faster execution\n- Allows recursive directory search\n- Option to crop all detected persons or just the largest one\n- Adds customizable margin to cropped images\n- Saves images with no detected persons in a separate directory\n- Option to remove small images after processing\n\n## Installation\n\n1. Clone this repository\n2. Install the required dependencies:\n\n```bash\npip install ultralytics rich typer opencv-python\n```\n\n3. Ensure you have the YOLOv8 models in your home directory under a `yolov8` folder.\n\n## Usage\n\nRun the script using the following command:\n\n```bash\npython main.py [OPTIONS]\n```\n\n### Options\n\n- `--margin-percentage INTEGER`: Margin percentage for bounding box (default: 3, recommended range: 0-10)\n- `--model-size INTEGER`: Model size (default: 640, recommended: 320, 640, or 1280)\n- `--model TEXT`: YOLOv8 model to use (options: yolov8x.pt, yolov8m.pt, yolov8s.pt)\n- `--recursive / --no-recursive`: Search for images recursively (default: False)\n- `--crop-all / --no-crop-all`: Crop all detected persons instead of just the largest (default: False)\n\n## How it works\n\n1. The script prompts you to select an input directory.\n2. It processes all images in the selected directory (and subdirectories if recursive option is enabled).\n3. Detected persons are cropped from the images with the specified margin.\n4. Cropped images are saved in a 'cropped' subdirectory within the input directory.\n5. Images with no detected persons are saved in a 'no-person' subdirectory.\n6. After processing, you have the option to remove small images based on a size threshold.\n",
"bugtrack_url": null,
"license": null,
"summary": "put yolov8m/n/x.pt in ~/.yolov8 and run",
"version": "1.1.1",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8773b8970a1a5a5fa9caebc91b4660a2f2f0a6e040faaa4674c29b985dadd0af",
"md5": "dcf73e2ff5a78cdbaa4f7b67f338473a",
"sha256": "95a6e38c8c967448c276154413873f085dcbc27563f5f391b4a0eb1eb5081821"
},
"downloads": -1,
"filename": "crop_yolo_v8-1.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dcf73e2ff5a78cdbaa4f7b67f338473a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 5054,
"upload_time": "2024-07-21T23:48:47",
"upload_time_iso_8601": "2024-07-21T23:48:47.807008Z",
"url": "https://files.pythonhosted.org/packages/87/73/b8970a1a5a5fa9caebc91b4660a2f2f0a6e040faaa4674c29b985dadd0af/crop_yolo_v8-1.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e561e3d8d7ddfbc67888c4a5adc79dc720edd434a113be3b649110ec0eca44fc",
"md5": "1a3dc17d8cd589ce98ffeefe951d14bc",
"sha256": "21f32c3a1da474374cfaf62356e6c37f4d26e543b4ba5e6e9fe08c912619a325"
},
"downloads": -1,
"filename": "crop_yolo_v8-1.1.1.tar.gz",
"has_sig": false,
"md5_digest": "1a3dc17d8cd589ce98ffeefe951d14bc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 4228,
"upload_time": "2024-07-21T23:48:49",
"upload_time_iso_8601": "2024-07-21T23:48:49.152672Z",
"url": "https://files.pythonhosted.org/packages/e5/61/e3d8d7ddfbc67888c4a5adc79dc720edd434a113be3b649110ec0eca44fc/crop_yolo_v8-1.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-21 23:48:49",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "crop-yolo-v8"
}