Coder Social home page Coder Social logo

swatimodi / portrait-segmentation-mediapipe Goto Github PK

View Code? Open in Web Editor NEW
58.0 3.0 16.0 305.26 MB

Realtime Portrait Segmentation with Tflite and MediaPipe

License: Apache License 2.0

Starlark 7.98% Dockerfile 0.04% Shell 0.18% Python 3.92% C++ 78.57% C 0.66% Java 5.23% HTML 0.04% JavaScript 0.05% Objective-C 1.49% Objective-C++ 1.82% Batchfile 0.01% Makefile 0.01%
realtime portrait-segmentation mediapipe tflite custom-model android desktop

portrait-segmentation-mediapipe's People

Contributors

swatimodi 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

portrait-segmentation-mediapipe's Issues

Training Code for Model on Custom Data

@SwatiModi Thanks for such a nice work. I have a question related to the training model . I am working same sort of the problem , so I am using u2net segmentation Model for my solution . But it is really slow when I integrate it with my web-app code to run in the browser. Can you suggest me any way to improve my speed or can you provide your python training and testing script , So I can use it for my problem. Thanks

APK not working properly.

Hello Swati
I tried running your code but ran into some error

/mediapipe/mediapipe/examples/android/src/java/com/google/mediapipe/apps/portraitsegmentationgpu/BUILD:35:15: Merging manifest for //mediapipe/examples/android/src/java/com/google/mediapipe/apps/portraitsegmentationgpu:portraitsegmentationgpu failed (Exit 1): ResourceProcessorBusyBox failed: error executing command bazel-out/k8-opt-exec-50AE0418/bin/external/bazel_tools/src/tools/android/java/com/google/devtools/build/android/ResourceProcessorBusyBox --tool MERGE_MANIFEST -- --manifest ... (remaining 11 argument(s) skipped)

a person here had the same issue, so i tried the solution given to him about adding converterNumBuffers paramerter into the BUILD and was then able to build the APK.

However, the built APK is still not working ( it is asking for camera permission, but the screen is black the whole time).
Since, I don't have much knowledge about android, could you also help me in debugging this.

Help in running the build command for the model on Desktop

Hi Swati, Thank you so much for this awesome post.

Based on this - Link I have been trying to run the build command, but I have been getting some errors. Could you suggest some solution?

INFO: Repository local_execution_config_python instantiated at:
C:/users/gd19/pycharmprojects/mediapipe-custom/WORKSPACE:403:14: in
C:/users/gd19/_bazel_gd19/gyx2hd7f/external/org_tensorflow/tensorflow/workspace2.bzl:868:19: in workspace
C:/users/gd19/_bazel_gd19/gyx2hd7f/external/org_tensorflow/tensorflow/workspace2.bzl:91:27: in _tf_toolchains
C:/users/gd19/_bazel_gd19/gyx2hd7f/external/tf_toolchains/toolchains/remote_config/configs.bzl:6:28: in initialize_rbe_configs
C:/users/gd19/_bazel_gd19/gyx2hd7f/external/tf_toolchains/toolchains/remote_config/rbe_config.bzl:158:27: in _tensorflow_local_config
Repository rule local_python_configure defined at:
C:/users/gd19/_bazel_gd19/gyx2hd7f/external/org_tensorflow/third_party/py/python_configure.bzl:279:41: in
ERROR: An error occurred during the fetch of repository 'local_execution_config_python':
Traceback (most recent call last):
File "C:/users/gd19/_bazel_gd19/gyx2hd7f/external/org_tensorflow/third_party/py/python_configure.bzl", line 213, column 33, in _create_local_python_repository
python_lib = _get_python_lib(repository_ctx, python_bin)
File "C:/users/gd19/_bazel_gd19/gyx2hd7f/external/org_tensorflow/third_party/py/python_configure.bzl", line 130, column 21, in _get_python_lib
result = execute(repository_ctx, [python_bin, "-c", cmd])
File "C:/users/gd19/_bazel_gd19/gyx2hd7f/external/org_tensorflow/third_party/remote_config/common.bzl", line 230, column 13, in execute
fail(
Error in fail: Repository command failed
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
ERROR: C:/users/gd19/pycharmprojects/mediapipe-custom/WORKSPACE:403:14: fetching local_python_configure rule //external:local_execution_config_python: Traceback (most recent call last):
File "C:/users/gd19/_bazel_gd19/gyx2hd7f/external/org_tensorflow/third_party/py/python_configure.bzl", line 213, column 33, in _create_local_python_repository
python_lib = _get_python_lib(repository_ctx, python_bin)
File "C:/users/gd19/_bazel_gd19/gyx2hd7f/external/org_tensorflow/third_party/py/python_configure.bzl", line 130, column 21, in _get_python_lib
result = execute(repository_ctx, [python_bin, "-c", cmd])
File "C:/users/gd19/_bazel_gd19/gyx2hd7f/external/org_tensorflow/third_party/remote_config/common.bzl", line 230, column 13, in execute
fail(
Error in fail: Repository command failed
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
ERROR: Analysis of target '//mediapipe/examples/desktop/portrait_segmentation:portrait_segmentation_cpu' failed; build aborted: Repository command failed
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
INFO: Elapsed time: 4.871s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (36 packages loaded, 11 targets configured)

Thank you so much.

Object Detection

I know this is outside the scope of your tutorial, but I am curious if you have any information that might help me with either creating my own or adding to their model. I have used TF ModelMaker to make a model of objects and after looking at my model and their object_detection_3d_sneakers tflite files in Netron I am assuming that the tf Model Maker file is a very basic format. I am new to ML in general so any guidance would be appreciated.

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.