GithubHelp home page GithubHelp logo

zubairahmed-ai / live-background-blur Goto Github PK

View Code? Open in Web Editor NEW
52.0 52.0 12.0 6 KB

2 days ago Microsoft introduced Teams with a background blur feature for video calls using AI, so I used AI to build my own

Python 100.00%

live-background-blur's People

Contributors

zubair-ahmed-ai 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

live-background-blur's Issues

deeplab tensorflow model_test.py works fine, but can't see import in main

Hello, Zubair!
I would like to use deeplab on macOS Python 3.7. I have to install tensorflow v1.15 (due to deeplab compatibility problem).
I install tensorflow models and extract it to:
./PROJECT_NAME/venv/lib/python3.7/site-packages/tensorflow.

Now, I have read in tensorflow installation guide, that I should execute in terminal:

>>> $ pwd
>>> ./PROJECT_NAME/venv/lib/python3.7/site-packages/tensorflow/models/research
>>> $ export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim.

After that I test it from the same path: $ python deeplab/model_test.py and it works fine:

Ran 5 tests in 35.463s
OK (skipped=1)

PROBLEM: So, I would like to test it in my project in path PROJECT_NAME/main.py simple way:

from matplotlib import pyplot as plt
import cv2

from model import Deeplabv3
# according your code I trying to run this
deeplab_model = Deeplabv3()

and $ python main.py gives me:

    from model import Deeplabv3
ModuleNotFoundError: No module named 'model'

I have already tried to move deeplab model folder to ./PROJECT_NAME/ and in another way move main.py to deeplab folder:

from deeplab import model # this way import
deeplab_model = Deeplabv3()
NameError: name 'Deeplabv3' is not defined

I'm not very familiar in python. Thanks for any information!

how can you approach real time?

Hi, I tried your implementation and it works fine, it blurred the background pretty well, but I don't have the same performance you show in video in the README.md, Could there be a problem with the way I set up the project? I couldn't install cuda, so i set up the older version of keras-deeplab-v3-plus. Now I'm having like 1 frame per second, how many do you have? I now that the slowest part is when deeplab_model.predict is called but I don't understand where the method predict is.
Thanks in advance.

I'm running this on:

  • Ubuntu 18.04
  • Proccessor model: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz

Result is good but could be smoother

It seems like there is extra padding around the foreground object. Any ideas on how to reduce padding (smoothen) to get a more accurate profile/outline???

Code:
https://pastebin.com/UNeNFbgm

Related post:?
https://www.pyimagesearch.com/2018/11/26/instance-segmentation-with-opencv/

A simple yet effective update to our instance segmentation pipeline would be to potentially:

Use morphological operations to increase the size of our mask
Apply a small amount of Gaussian blurring to the mask itself, helping smooth the mask
Scale the mask values to the range [0, 1]
Create an alpha layer using the scaled mask
Overlay the smoothed mask + person ROI on the blurred background

Alternatively, you could compute the contours of the mask itself and then apply contour approximation to help create a “more smoothed” mask.

animated gif-downsized_large

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.