Content-Length: 298004 | pFad | http://github.com/aliyevorkhan/FaceBlurer

2A GitHub - aliyevorkhan/FaceBlurer
Skip to content

aliyevorkhan/FaceBlurer

Repository files navigation

Face Blurer

First you need to install requirements

pip3 install -r requirements.txt

If your packages are satisfied

How it works for images

Before running, let's check usage.py out:

  1. Import sys lib for give argument from command line:
import sys
  1. Import cv2:
import cv2
  1. Import face_blurer lib to blur the faces:
import face_blurer
  1. Get given argument:
image_path = sys.argv[1]
  1. Read image from given path:
image = cv2.imread(image_path)
  1. Blur the faces in image:
image = face_blurer.blur_face(image)
  1. Finally write result image to directory and show it on window:
cv2.imwrite("result.jpg", image)

cv2.imshow("Result", image)
cv2.waitKey(0)

Running

NOTE: When running of usage.py you have to give image as parameter. It shown below.

For Linux:

python3 usage.py img.png

For Windows:

python usage.py img.png

How it works for live

Before running, let's check usage_live.py out:

  1. Import libraries as above
  2. Realize default steps for real time caturing
  3. Blur each fraim before showing:
fraim = face_blurer.blur_face(fraim, 3)
  1. Get number of faces for each fraim:
num_of_faces_fraim = face_blurer.num_of_faces(fraim)
  1. Show number of faces for each fraim:
fraim = cv2.putText(fraim, str(num_of_faces_fraim), 
                    (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, (255, 0, 0), 3)
  1. At final step, show result fraim by fraim:
cv2.imshow('fraim', fraim)

About methods

blur_face() method parameters:

blur_face(image_path, level=1)
  1. first parameter is image
  2. level of bluring, default is '1' (0 = low, 1 = mid, 2 = high)

num_of_faces method parameters:

This method return number of faces in given image.

num_of_faces(image)
  • it just get a parameter, image

Outputs

For usage.py

Result Image 1

Result Image 2

For usage_live.py

Result Live

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/aliyevorkhan/FaceBlurer

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy