Skip to main content

A image cropping library

Project description

PyPI version Build Status Coverage Status

Face cropper

Welcome to the face cropper module !
This module will :

  • Automatically detect faces on a provided picture
  • Return the biggest one
  • Save it in a location of your choosing !

Requirements

  • Python > 3.7
  • pip > 20.1.1

Quickstart

Use as a package ?
  • pip install face-cropper
Use as a CLI ?
  • Clone the repo
  • pip install -r requirements.txt
  • python main.py --image_path=path\to\my\image --saving_path=where\to\save\cropped\image

CLI documentation

Just run the main.py module

Required arguments :
  • image_path : The path of the image to be cropped
  • saving_path : The path where the cropped image should be saved
Optionnal arguments :
  • verbose : Wether or not the command should output informations about the face detections

Module documentation

Simply import the crop function, and pass it the path of the image to be cropped as image_path !
It is also possible to pass it another parameter, saving_path, which if provided will make face_croper save the image in the provided location !

Example
import os

from face_cropper import crop

cropped_image = crop(
    image_path=os.path.join(os.getcwd(), "my_image.jpg")
)
import os

from face_cropper import crop

cropped_image = crop(
    image_path=os.path.join(os.getcwd(), "my_image.jpg"),
    saving_path=os.getcwd()
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

face_cropper-1.0.0.tar.gz (7.8 kB view details)

Uploaded Source

File details

Details for the file face_cropper-1.0.0.tar.gz.

File metadata

  • Download URL: face_cropper-1.0.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.1

File hashes

Hashes for face_cropper-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4622c28c07953612d377e355e6f016f6ab1930db4a0a76debab7746c745d9551
MD5 69adb36bb5ad9e9b6ae1bc0f5afc2f48
BLAKE2b-256 488bb828152e995229f0c2f6ee5417dbecc6479f42f7ce9c94223d2f78dc50c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page