Code Monkey home page Code Monkey logo

silhouette-extractor-mmdet's Introduction

Human Silhouette Extractor Using MMDetection Instance Segmentation Models License: MIT

This is a tool to extract silhouettes from images or videos using MMDetection. It uses the first model shown in the SCNet page by default. Currently providing out-of-the-box support for the Decoupled Light SOLO model as well for faster performance with the caveat that the silhouettes are far less refined in the edges.

An example for images is shown below.

Original Image Silhouette
walking walking-output

Image credits to Verywell Fit.

Setup

  1. Install MMDetection as outlined in this tutorial.
  2. Install tqdm in the virtual environment used to install MMDetection.
  3. Clone this repository.

Usage

The use of the tools will mainly be through the CLI. If this is the first time running, the scripts will download the model checkpoint to the checkpoints folder.

Video Extractor

This will use video_extractor.py.

$ python video_extractor.py -h

usage: video_extractor.py [-h] [-i INPUT] [-o OUTPUT] [-m | --multiple | --no-multiple] [--threshold THRESHOLD] [--model MODEL]

Video Silhouette Extractor Using Various Instance Segmentation Models

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        The path to the image file.
  -o OUTPUT, --output OUTPUT
                        Output path. Make sure the directory exists.
  -m, --multiple, --no-multiple
                        Toggles detecting multiple people.
  --threshold THRESHOLD
                        Threshold for inference detector. Default: 0.3.
  --model MODEL         Inference detector model choice. Default: 'scnet-r50-fpn'. Options: 'd-solo-light', 'scnet-r50-fpn'.

Image Extractor

This will use image_extractor.py.

$ python image_extractor.py

usage: image_extractor.py [-h] [-i INPUT] [-o OUTPUT] [-m | --multiple | --no-multiple] [--threshold THRESHOLD] [--model MODEL]

Image Silhouette Extractor Using Various Instance Segmentation Models

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        The path to the image file.
  -o OUTPUT, --output OUTPUT
                        Output path. Make sure the directory exists.
  -m, --multiple, --no-multiple
                        Toggles detecting multiple people.
  --threshold THRESHOLD
                        Threshold for inference detector. Default: 0.3.
  --model MODEL         Inference detector model choice. Default: 'scnet-r50-fpn'. Options: 'd-solo-light', 'scnet-r50-fpn'.

Acknowledgement

We would like to acknowledge the MMDetection, SCNet, and SOLO team for their great work, and also the insights gained from a long-closed issue in MMDetection. Everything in the configs folder is attributed to MMDetection.

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.