cv

cv / CensorFace / 0.1.3

README.md

Introduction

Automatically censor faces in a given image. This algorithm uses the dlib/FaceDetection algorithm to detect faces and censor them.

Input

  • ​(Required): Image(s)
  • (Optional): Filling color (default=black) or blur
  • (Optional): Save directory location (default="data://.algo/temp")
  • (Optional): Output location

Output

  • DataAPI output image location(s)

Example(s)

Example 1.

  • ​Parameter 1: Single image
{
  "images": [
    "https://upload.wikimedia.org/wikipedia/commons/b/b6/Obamamiltondavis1.jpg"
  ]
}

Output:

{
  "output":[
    "data://.algo/cv/CensorFace/temp/d911ad96-b136-4566-ae56-49183a81bc31.png"
  ]
}

Example 2.

  • ​Parameter 1: Multiple images
{
  "images": [
    "https://upload.wikimedia.org/wikipedia/commons/b/b6/Obamamiltondavis1.jpg",
    "https://upload.wikimedia.org/wikipedia/commons/b/b6/Obamamiltondavis1.jpg"
  ]
}

Output:

{
  "output":[
    "data://.algo/cv/CensorFace/temp/d911ad96-b136-4566-ae56-49183a81bc31.png",
    "data://.algo/cv/CensorFace/temp/250d7816-033b-4d1f-9298-898b5f1f6cd8.png"
  ]
}

Example 3.

  • ​Parameter 1: Single image
  • Parameter 2: RGB filling color
{
  "images": [
    "https://upload.wikimedia.org/wikipedia/commons/b/b6/Obamamiltondavis1.jpg"
  ],
  "fill_color": [120, 50, 70]
}

Output:

{
  "output": [
    "data://.algo/cv/CensorFace/temp/ebd29eec-f5d0-4746-948a-64516cf59b74.png"
  ]
}

Example 4.

  • ​Parameter 1: Single image
  • Parameter 2: Image blur
{
  "images": [
    "https://upload.wikimedia.org/wikipedia/commons/b/b6/Obamamiltondavis1.jpg"
  ],
  "fill_color": "blur"
}

Output:

{
  "output": [
    "data://.algo/cv/CensorFace/temp/85185419-775a-4fc3-995d-f42c8a2199d3.png"
  ]
}

Example 5.

  • ​Parameter 1: Single image
  • Parameter 2: Censored output directory location
{
  "images": [
    "https://upload.wikimedia.org/wikipedia/commons/b/b6/Obamamiltondavis1.jpg"
  ],
  "output_dir": "data://.my/collection/"
}

Output:

{
  "output": [
    "data://.algo/cv/CensorFace/temp/85185419-775a-4fc3-995d-f42c8a2199d3.png"
  ]
}

Example 6.

  • ​Parameter 1: Single image
  • Parameter 2: Censored output image location
{
  "images": [
    "https://upload.wikimedia.org/wikipedia/commons/b/b6/Obamamiltondavis1.jpg"
  ],
  "output_loc": [
    "data://.algo/cv/CensorFace/temp/censor_image.png"
  ]
}

Output:

​{
  "output": [
    "data://.algo/cv/CensorFace/temp/censor_image.png"
  ]
}

Credit

Image we're retrieved from Wikipedia.

Used dlib/FaceDetection to detect faces in the given image.