GithubHelp home page GithubHelp logo

Comments (4)

SilverDestiny avatar SilverDestiny commented on June 1, 2024

Hi @arianaa30 ,

Is the input static image/single image? If yes, you need to use SelfieSegmenterOptions.SINGLE_IMAGE_MODE instead of SelfieSegmenterOptions.STREAM_MODE.

I tested by https://github.com/googlesamples/mlkit/tree/master/android/vision-quickstart amd on Pixel 3 device with 1440x1080 input resolution, the inference is around ~30ms.

Please note that the 1st inference is higher than the following inferences because of initialization task and OS scheduling. Streaming mode's latency might be stable, you can also check it from the streaming activities in https://github.com/googlesamples/mlkit/tree/master/android/vision-quickstart

from mlkit.

arianaa30 avatar arianaa30 commented on June 1, 2024

Hmm is there anything weird with the above script that makes it slower on a higher-end phone? It's doing the same thing as vision-quikstart. It's from your online tutorial.
In my case, I have to pass every frame of video as media.Image to this module to process, and get the results back. So it's considered a STREAM mode eventually.

from mlkit.

SilverDestiny avatar SilverDestiny commented on June 1, 2024

I didn't see any issue in the code snippet you provided above.

Probably one thing to note is that please make sure the result task runs immediately after it's created. If there're other pending tasks, the calculated latency might be high as the result task might be waiting to be run

from mlkit.

arianaa30 avatar arianaa30 commented on June 1, 2024

@SilverDestiny per your suggestion, in my code snippet above, I'm running the result task immediately after it's created right? Is this what you mean?

    Task<SegmentationMask> result =
            segmenter.process(image)
                    .addOnSuccessListener(
                            new OnSuccessListener<SegmentationMask>() {

from mlkit.

Related Issues (20)

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.