Skip to content

Resolution is low #3

Open
Open

Description

@zzzzzzpc

I build the application according to the guide, but the resolution is so low.

by the way, my phone is xiaomi10, and the resolution of my phone is 1920*1080p.

Any solution? pls!

Activity

  1. SwatiModi commented on Dec 27, 2020

    @SwatiModi
    Owner

    Hey, currently the resolution is 224x224
    you can change it as follows

    1. resize the input image to 224x224(model's input-size), predict and get the 224x224 background mask
    2. resize both(input image and background mask) to original size(can be anything, say 1920*1080)
    3. background replacement can be done same as now
  2. zzzzzzpc commented on Mar 6, 2021

    @zzzzzzpc
    Author

    Hey, currently the resolution is 224x224
    you can change it as follows

    1. resize the input image to 224x224(model's input-size), predict and get the 224x224 background mask
    2. resize both(input image and background mask) to original size(can be anything, say 1920*1080)
    3. background replacement can be done same as now
  3. zzzzzzpc commented on Mar 6, 2021

    @zzzzzzpc
    Author

    Hey, currently the resolution is 224x224
    you can change it as follows

    1. resize the input image to 224x224(model's input-size), predict and get the 224x224 background mask
    2. resize both(input image and background mask) to original size(can be anything, say 1920*1080)
    3. background replacement can be done same as now

    thankkkkk u! i have solved the problem!
    but now i meet a new trouble, i want change the background picture realtime without switching a new activity in android. could u give me some advice?

  4. zzzzzzpc commented on Mar 6, 2021

    @zzzzzzpc
    Author

    Hey, currently the resolution is 224x224
    you can change it as follows

    1. resize the input image to 224x224(model's input-size), predict and get the 224x224 background mask
    2. resize both(input image and background mask) to original size(can be anything, say 1920*1080)
    3. background replacement can be done same as now

    thankkkkk u! i have solved the problem!
    but now i meet a new trouble, i want change the background picture realtime without switching a new activity in android. could u give me some advice?

    its like i put a button and when i press it, a new background picture will show. it seems i have to add or modify the calculator.

  5. SwatiModi commented on Mar 7, 2021

    @SwatiModi
    Owner

    Yaa, you can actually do this by creating a new input stream which will decide the background image.
    Current I have hard-coded the background image here

    Let's consider you have a int mapping of these names for now like 1:buildings.png, 2:cloulds.png etc ( alternatively you could also add a image input stream instead )

    So you would have to

    1. write a small data handler class for this the main activity java file which will send a int input packet on every frame, the button listener logic you can write as you want,
    2. in the background_masking_calculator you would have to accept the input stream and decide the image name from the mapping you would maintain
    3. declare this input stream in the graph as well and pass it as input to the background masking node

    Here's a example which would help you with this, here we wanted to send the R, G, B values dynamically from the app UI (similar to your use case), it has the streams declared and stream packets sent from java side to the graph and utilized by the calculator

  6. jls502 commented on Jul 15, 2021

    @jls502

    Hey, currently the resolution is 224x224
    you can change it as follows

    1. resize the input image to 224x224(model's input-size), predict and get the 224x224 background mask
    2. resize both(input image and background mask) to original size(can be anything, say 1920*1080)
    3. background replacement can be done same as now

    thankkkkk u! i have solved the problem!
    but now i meet a new trouble, i want change the background picture realtime without switching a new activity in android. could u give me some advice?

    hi, how did y sovle the problem of low resolution ?

  7. ya332 commented on Jan 12, 2022

    @ya332

    @SwatiModi, Can you share the full repo for the Hair Color Slider (google-ai-edge/mediapipe#420) as I am having adding the ColorSliderCalculator.cc object. Thanks.

    EPTION: ExternalTextureConverter
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: Process: com.google.mediapipe.apps.hairsegmentationgpu, PID: 8544
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: com.google.mediapipe.framework.MediaPipeException: unknown: ValidatedGraphConfig Initialization failed.
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: No registered object with name: ColorSliderCalculator; Unable to find Calculator "ColorSliderCalculator"
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: RecolorCalculator::GetContract failed to validate: 
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: For input streams ValidatePacketTypeSet failed:
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: Tag "RGB_OUT" index 0 was not expected.
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: 	at com.google.mediapipe.framework.Graph.nativeStartRunningGraph(Native Method)
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: 	at com.google.mediapipe.framework.Graph.startRunningGraph(Graph.java:324)
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: 	at com.google.mediapipe.components.FrameProcessor.startGraph(FrameProcessor.java:553)
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: 	at com.google.mediapipe.components.FrameProcessor.maybeAcceptNewFrame(FrameProcessor.java:421)
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: 	at com.google.mediapipe.components.FrameProcessor.onNewFrame(FrameProcessor.java:439)
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: 	at com.google.mediapipe.components.ExternalTextureConverter$RenderThread.renderNext(ExternalTextureConverter.java:403)
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: 	at com.google.mediapipe.components.ExternalTextureConverter$RenderThread.lambda$onFrameAvailable$0$ExternalTextureConverter$RenderThread(ExternalTextureConverter.java:338)
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: 	at com.google.mediapipe.components.ExternalTextureConverter$RenderThread$$Lambda$0.run(Unknown Source:4)
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:938)
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:246)
    01-11 20:52:37.352  8544  9546 E AndroidRuntime: 	at com.google.mediapipe.glutil.GlThread.run(GlThread.java:141)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions