Coder Social home page Coder Social logo

philippmatthes / neural-greenscreen Goto Github PK

View Code? Open in Web Editor NEW
37.0 3.0 6.0 11.8 MB

Real time background replacement on a mac os driven webcam using the DeepLabV3 neural network for image segmentation and the native CoreMediaIO DAL framework of Mac OS.

Home Page: https://philippmatthes.medium.com/how-to-create-a-system-wide-plugin-for-mac-os-which-removes-the-background-of-the-webcam-2cb88a94dc7b

License: MIT License

Swift 92.94% Objective-C 2.68% Metal 4.38%
zoom camera background-replacement core-media-io dal background-removal plugin

neural-greenscreen's Introduction

Neural Greenscreen

Architecture

Realtime background removal with neural networks on mac os, providing a virtual camera, which can be accessed by third party applications. ➡️ Read the Medium article

Demo

Based on seanchas116/SimpleDALPlugin and johnboiles/coremediaio-dal-minimal-example.

Prerequesites

  • A system running mac os with a builtin webcam
  • Xcode

Setup

  • Check your webcam dimensions and change the code (and the background) if your webcam has a higher resolution than 1280 x 720
  • Build neural-greenscreen in Xcode
  • Copy neuralGreenscreenMain.plugin into /Library/CoreMediaIO/Plug-Ins/DAL
  • Open app that uses your webcam and choose Neural Greenscreen as camera input

You should see the background being replaced.

Troubleshooting

DAL plugins access very low level mac os interfaces. It could be that the plugin is not detected or crashes depending on your system or app. If you find a problem, report it so that we can fix it. Here is a recommended workflow:

  • Check your logs (using the mac os console, search for neural)
  • Open an issue explaining your problem

License

This project is licensed under MIT License.

neural-greenscreen's People

Contributors

dependabot[bot] avatar philippmatthes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

neural-greenscreen's Issues

Support for Apple Silicon Macs and third-party webcams

Doesn't seem to work, crashes obs. I tried both code settings for 720p and 1080p. Would be nice if there was a way to choose external "USB Camera" (webcam) if it was plugged in. I'm not sure how to set default video device in mac. Nice work on this regardless if I can get it working.

MacBook Pro (16-inch, 2021)
MacOS Monterey 12.6

default	09:04:49.637339-0400	OBS	Neural Greenscreen: DeviceStartStream(plugin:deviceID:streamID:):
default	09:04:50.180830-0400	OBS	neuralGreenscreenMain/NeuralGreenscreen.swift:154: Fatal error: Failed to render output texture
default	09:04:51.015764-0400	ReportCrash	ASI found [libswiftCore.dylib] (sensitive) 'neuralGreenscreenMain/NeuralGreenscreen.swift:154: Fatal error: Failed to render output texture'

[ Question ] How will you release this as a mac app ?

Will you be able to release your current project with node.js as an mac app ? and also why you haven't gone with coreml since the upcoming apple silicons are going to have ANE in them ? also sorry for using issues page for this.

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.