You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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.
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
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,
in the background_masking_calculator you would have to accept the input stream and decide the image name from the mapping you would maintain
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
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 ?
@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)
Activity
SwatiModi commentedon Dec 27, 2020
Hey, currently the resolution is 224x224
you can change it as follows
zzzzzzpc commentedon Mar 6, 2021
zzzzzzpc commentedon Mar 6, 2021
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?
zzzzzzpc commentedon Mar 6, 2021
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.
SwatiModi commentedon Mar 7, 2021
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
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
jls502 commentedon Jul 15, 2021
hi, how did y sovle the problem of low resolution ?
ya332 commentedon Jan 12, 2022
@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.