Giter Club home page Giter Club logo

semanticsegmentationmetaldemo's Introduction

Semantic segmentation demo

This is a simple iOS app that uses the DeepLab V3+ semantic segmentation model on the real-time camera feed and applies some graphical effects to the image using the predicted segmentation mask.

THIS IS NOT PRODUCTION-QUALITY CODE! But you might find it useful as a demo of how to take an MLMultiArray output from Core ML and draw it on the screen using Metal.

Note that the DeepLab model applies an argmax to the output and returns the segmentation mask as one INT32 value for each pixel. For more info about this, see my e-book Core ML Survival Guide.

Usage instructions:

  • tap camera button to switch between front and back camera

  • use menu to choose a graphical effect

  • drag controller (white circle) up/down and left/right to change settings for current graphical effect

  • tap bottom left corner to enable/disable live video preview (useful for debugging)

Available graphical effects

  • blend between original input and segmentation mask (all classes)

  • draw shadow on a fake background; controller determines position of the "light source"

  • change brightness and saturation (using RGB <-> HSV conversion)

  • pixelate the background and/or the person

  • blur the background (the blur size is fixed)

  • add a simple purple-ish glow around any persons

License

Do whatever you want with it. I DO NOT OFFER ANY SUPPORT FOR THIS REPO!

The DeepLab model is taken from TensorFlow and is licensed under the Apache License.

semanticsegmentationmetaldemo's People

Contributors

hollance avatar

Watchers

James Cloos 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.