https://github.com/mrtj/face-obfuscator
Obfuscate human faces in video files
https://github.com/mrtj/face-obfuscator
Last synced: 12 months ago
JSON representation
Obfuscate human faces in video files
- Host: GitHub
- URL: https://github.com/mrtj/face-obfuscator
- Owner: mrtj
- Created: 2021-07-09T10:44:11.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-23T12:05:37.000Z (almost 5 years ago)
- Last Synced: 2025-03-06T06:19:26.116Z (over 1 year ago)
- Language: Python
- Size: 38.1 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Face Obfuscator
Face Obfuscator obfuscates human faces in a video.
## Installation
### AWS EC2
1. Follow the [detailed guide](ec2.md) to install docker, docker-compose and optionally NVIDIA Container Toolkit on a EC2 instance.
2. Clone this repo on the instance:
```bash
$ git clone https://github.com/mrtj/face-obfuscator.git
```
## Running
1. Place the input video(s) in the `input` folder:
```bash
$ cd face-obfuscator
$ cp path/to/my_input_video.mp4 input/my_input_video.mp4
```
2. Run the application with `docker-compose`. The first time you execute this command, docker will build the application image. This can take some time. Successive executions will be faster.
```bash
$ docker-compose up --build
```
3. The application will try to open each video files in the `input` folder, blur the faces on each frame of the video, and save the blurred video to the `output` folder.
### Skipping frames and reducing resolution
You can choose to process only every *n*th frame and to reduce the resolution of the input video. These options can speed up the video processing, but they will result in a lower quality output video. If you reduce the video resolution, the face detector might also not find all small faces. The processing time should be speeded up approximately by a factor of the product of the downscale variables.
The following environment variables control skipping frames and reducing resolution:
- `DOWNSCALE_FPS`: specifies to process only every *n*th frame.
- `DOWNSCALE_RES`: specifies the downscale factor of the resolution of the input video.
For example, calling `face_obfuscator` with this command:
```bash
$ DOWNSCALE_FPS=4 DOWNSCALE_RES=2 docker-compose up --build
```
will make the obfuscator to process only every 4th frame, and change the width and height of the video to half size. Approximately 8x faster processing time can be expected.