{"id":16461638,"url":"https://github.com/haofanwang/cropimage","last_synced_at":"2025-03-21T05:31:01.021Z","repository":{"id":62053786,"uuid":"408400319","full_name":"haofanwang/cropimage","owner":"haofanwang","description":"A simple toolkit for detecting and cropping main body from pictures. Support face and saliency detection.","archived":false,"fork":false,"pushed_at":"2021-10-12T09:38:49.000Z","size":29011,"stargazers_count":44,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T15:19:11.886Z","etag":null,"topics":["crop-image","cropper","image-crop","image-resize","image-saliency","main-body-crop","mtcnn-face-detection","opencv","python","smart-image-crop"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haofanwang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-20T10:32:08.000Z","updated_at":"2024-12-06T13:33:56.000Z","dependencies_parsed_at":"2022-10-25T19:01:21.679Z","dependency_job_id":null,"html_url":"https://github.com/haofanwang/cropimage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haofanwang%2Fcropimage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haofanwang%2Fcropimage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haofanwang%2Fcropimage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haofanwang%2Fcropimage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haofanwang","download_url":"https://codeload.github.com/haofanwang/cropimage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244745681,"owners_count":20503044,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crop-image","cropper","image-crop","image-resize","image-saliency","main-body-crop","mtcnn-face-detection","opencv","python","smart-image-crop"],"created_at":"2024-10-11T11:08:53.994Z","updated_at":"2025-03-21T05:30:59.254Z","avatar_url":"https://github.com/haofanwang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cropimage\n\n[![Colab](https://camo.githubusercontent.com/84f0493939e0c4de4e6dbe113251b4bfb5353e57134ffd9fcab6b8714514d4d1/68747470733a2f2f636f6c61622e72657365617263682e676f6f676c652e636f6d2f6173736574732f636f6c61622d62616467652e737667)](https://colab.research.google.com/drive/18jqXa1V-v5FXoCcY2MVg3FC3CFcOAk63?usp=sharing) [![PyPI version](https://badge.fury.io/py/cropimage.svg)](https://badge.fury.io/py/cropimage) ![Python](https://img.shields.io/badge/python-v3.5.0+-success.svg) [![Downloads](https://static.pepy.tech/personalized-badge/cropimage?period=month\u0026units=international_system\u0026left_color=grey\u0026right_color=brightgreen\u0026left_text=Downloads)](https://pepy.tech/project/cropimage) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/haofanwang/cropimage/issues)\n\nCropImage is a simple toolkit for image cropping. Different from other projects that mainly tackle face region, we extend to all kinds of images such as landscape. We support horizontal and portrait size and generate a square output.\n\n\u003cp align=\"center\"\u003e\u003cimg title=\"crop_example\" src=\"https://github.com/haofanwang/cropimage/raw/main/assets/example.png\"\u003e\u003c/p\u003e\n\n## Installation\n~~~sh\npip install cropimage\n~~~\n\n## Get Started\n~~~python\nfrom cropimage import Cropper\n\ncropper = Cropper()\n\n# Get a Numpy array of the cropped image\n# Set completeness to be True if you expect the 'face' to be focused rather than 'person'\n# Set target_size to be a tuple (size, size), only square output is supported now\nresult = cropper.crop('./images/input.jpg')\n\n# Save the cropped image\ncv2.imwrite('cropped.jpg', result)\n~~~\n\n## More Results\n\u003cp align=\"center\"\u003e\u003cimg title=\"crop_example\" src=\"https://github.com/haofanwang/cropimage/raw/main/assets/example1.png\"\u003e\u003c/p\u003e\n\n## Contributing\nIf you find any issue of this project, feel free to open an issue or contribute!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaofanwang%2Fcropimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaofanwang%2Fcropimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaofanwang%2Fcropimage/lists"}