Skip to content

SergeyKalutsky/vsc

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
vsc
 
 
 
 
 
 
 
 
 
 

videostream_censor

Real-time video stream censor. The project combines OBS script and mobilenet model for real-time NSFW classification of the video stream captured from display source. In case of inappropriate imagery detection, the script tells OBS to blur recording.

gifs website gifs website

Small demonstration of how it works. (Recording looks a little bit weird because it was done on gcloud VM):

https://www.youtube.com/watch?v=mGjkkCDoM00

https://www.youtube.com/watch?v=5ktVHWu-jgc&t=57s

Requirements

To run:

  • Tensorflow
  • Python 3.6+
  • OBS Studio

To run fast:

  • OBS Studio
  • Python 3.6+
  • GPU version of Tensorflow
  • NVIDIA® GPU card with CUDA® Compute Capability 3.5 or higher. See the list of CUDA-enabled GPU cards

Installation

  1. Download python 3.6+
  2. Install Tensorflow
  3. Clone or download this repository
  4. Install dependencies:
$ pip install -r /path/to/requirements.txt
  1. Add python path to OBS and upload script.
  2. Create new display source, crop the exact region you want to monitor on the underlying source and apply blur to it

There are two ways to apply blur:

You can do either way, it shouldn't really matter since the source will be disabled most of the time.

Important note:

Before desktop screenshot is fed to classifier it is resized to 224x224 pxl ratio. Obviously, a lot of features of the image are lost due to compression. In this case, the smaller initial screen region the better will be quality of the resized image and prediction accuracy.

  1. Configure scripts settings:

img

Setting Description
Prediction threshold How "sure" algorithm should be in order to classify something as NSFW. If the value is to low there will be a lot of noise and false positives, if too high it may not detect problematic recording.
Monitor number Number of the display source monitor, as spesified in os settings.
Port Socket port
Quiry interval(ms) How often should obs script update "blur status", depends on speed of a classifier.
Blur Source Name of the display source used to blur recording.
  1. Disable source
  2. Run classifier.py
$ python path/to/classifier.py -v --port=5557

About

Real time video recording censor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages