Giter Site home page Giter Site logo

aia39 / object-based-mask-generation Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 131.04 MB

Object based mask generator is used to generate mask from a video from dataset of Office activity recognition.Mainly the task of this is to differentiate the video from irrelevant background object so that network can concentrate into important objects to classify better.

Python 99.66% Starlark 0.34%
object-detection faster-rcnn instance-segmentation tensorflow deep-learning colorcode actionrecognition

object-based-mask-generation's Introduction

Object-Based-Mask-Generation

Object based mask generator is used to generate mask from a video from dataset of Office activity recognition. Mainly the task of this is to differentiate the video from irrelevant background object so that network can concentrate into important objects to classify better. It was based on Inception Resnet V2 feature extractor which performs best among all of the existed benchmarked model on COCO dataset.

This was developed for an alternative stream of optical flow. Our proposed network "SegCodeNet" is published here. A preprint for this is in the link.

Pipeline of the work is Pipeline of the work Getting the mask

This is implemented on Python 3 and TensorFlow. Here 13 objects from COCO dataset has been included for segmentation as these objects are important in office activity dataset. It's based on Instance segmentation and then assign specific color to same type of objects which is almost similar for detecting same type of class.

Some example of our work Raw & Masked video frame Sample Video 1 Sample Video 2

Coloring scheme for segmentation masks obtained from different class-relevant objects are :

Relevant Objects Color Color Code (R,G,B)
Person White (255,255,255)
TV, laptop, monitor Red (255,0,0)
Bottle, cup, wine glass Blue (0,0,255)
Cell phone Cyan (0,255,255)
Microwave, oven Yellow (255,255,0)
Sink & Light Blue (100,150,200)
Paper, book Magenta (255,0,255)
Keyboard Green (0,255,0)
Background/irrelevant objects Black (0,0,0)

The repository includes:

  • Source code of Mask R-CNN built on Inception Resnet V2 backbone to generate masked frame/video.

  • Source code of Privacy Protection. Main goal of this task to provide privacy to privacy sensitive objects in a video. Some example of privacy protection is given in this repo.

Getting Started

  1. Clone this repository

  2. Install dependencies

    conda install -c anaconda tensorflow-gpu
    conda install -c anaconda pillow
    conda install -c anaconda opencv
    conda install -c anaconda matplotlib
  3. Download pre-trained weights,classes names and related file from the Tensorflow model zoo. Download 'mask_rcnn_inception_resnet_v2_atrous_coco' from 'COCO-trained models' table. Put the .rar file in 'object_detection' folder. You can also download other models which gives mask as output. We select inception_resnet_V2 as it gives better result though computationally expensive.

  4. Create two folders in 'object_detection' folder 'test_directory_folder', 'protected_directory_folder' respectively for test videos and protected videos.

  5. Run the 'masking.py' in command window from 'object_detection' folder to generate masked video/frame.

  python masking.py
  1. (Extra) Run the 'protected.py' in command window from 'object_detection' folder generate privacy protected video/frame.
  python protected.py

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

Requirements

Python 3.4, TensorFlow 1.3,anaconda,opencv and other common packages. (If having trouble with TF 2.0 then you can install older version by: pip install tensorflow-gpu==1.14)

Dataset

Related Works

Acknowledgement

Tons of code was downloaded from theirs repo
https://github.com/tensorflow/models

object-based-mask-generation's People

Contributors

aia39 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

sidratul123

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.