Code Monkey home page Code Monkey logo

vsc's Introduction

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

vsc's People

Contributors

jleybovich avatar sergeykalutsky avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.