Git Product home page Git Product logo

privacy_protection_maskrcnn_resnet101's Introduction

Privacy Protection based on Mask_RCNN

This is an implementation of Mask R-CNN on Python 3, Keras, and TensorFlow.Privacy is protected by detecting sensitive objects and segmenting those from video.The model generates bounding boxes and segmentation masks for each instance of an object in the image. It's based on Feature Pyramid Network (FPN) and a ResNet101 backbone as feature extractor. Later better version was developed using different framework. Link of that repository.

Some example of the work : Privacy_Protected_Image2

The post processing part after instance segmentation can be described as : Privacy_Protected_Imaage Generation explained

The repository includes:

  • Source code of Mask R-CNN built on FPN and ResNet101.
  • Jupyter notebooks to visualize the detection pipeline at every step
  • Source code for Instance Segmentation in a Video
  • Source code for Privacy protection for single image
  • Source code for Privacy protection in a video

Installation

  1. Clone this repository

  2. Install dependencies

    pip3 install -r requirements.txt
  3. Run setup from the repository root directory

    python3 setup.py install
  4. Download pre-trained COCO weights (mask_rcnn_coco.h5) from the releases page.Download it from Mask R-CNN 2.0 -> assets -> mask_rcnn_coco.h5

  5. (Optional) To train or test on MS COCO install pycocotools from one of these repos. They are forks of the original pycocotools with fixes for Python3 and Windows (the official repo doesn't seem to be active anymore).

You can follow Mask_RCNN_Dependencies Installation to install every dependency required for this project.

Getting Started

  • visualize_cv2.ipynb Is the easiest way to start.It's an example of using a model pre-trained on MS COCO to segment objects in your own video(You should change the working directory of input image in code.For instance,a line in code capture = cv2.VideoCapture('working_directory\video name.file type') is desired.You should also change directory in every code in this repo)

  • demo+BlurredImage.ipynb It shows an example of using a model pre-trained on MS COCO to segment objects in your own images first and then it blur those sensitive images to provide privacy. It includes code to run object detection and instance segmentation on arbitrary images.

  • (model.py, utils.py, config.py,coco.py): These files contain the main Mask RCNN implementation.(Must keep these in the directory of main code)

  • Privacy_Protected.ipynb The main source code of our repository.It is the outcome of some modifications on Mask_RCNN.After instance segmentation we are able to detect sensitive objects in video and blur for privacy.Care should be taken as privacy is the main concern.You can observe the level of privacy protection whether it is noticable,distracting,disturbing or not.2 videos are provided to check its performance.We use these video as dataset as it was provided by IEEESPS for VIP Cup 2019.

  • Privacy_Protected_Save.ipynb This is the source code to make this task portable.A privacy protected MP4 video can be generated by it from a specific input folder containing multiple videos to a output folder.

Requirements

Python 3.4, TensorFlow 1.3, Keras 2.0.8,opencv and other common packages listed in requirements.txt.

Acknowledgement

Tons of code was downloaded from theirs repo

Citation

If you find our approach and code useful for your research (such as privacy aware action recognition and many more applications), please consider giving us citation :

@article{ghosh2020privacy,
  title={Privacy-Aware Activity Classification from First Person Office Videos},
  author={Ghosh, Partho and Istiak, Md and Rashid, Nayeeb and Akash, Ahsan Habib and Abrar, Ridwan and Dastider, Ankan Ghosh and Sushmit, Asif Shahriyar and Hasan, Taufiq and others},
  journal={arXiv preprint arXiv:2006.06246},
  year={2020}
}

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.