-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MaskOverlayCalculator black screen issue #3405
Comments
Hi @UnlimitedX , |
Hi @sureshdagooglecom , I use the Recolor Calculator to check if my videos are adequately provided to the Mediapipe graph. When the scaled_background_video is activated in the Recolor Calculator, showing the background_video packets are properly injected. (although the video is flipped vertically, no idea why) . The Selfie Segmentation mask is not applied. I don't know why. When the throttled_input_video is active in the recolor calculator, it works as expected. (I blurred my face for privacy reasons and only took a screenshot) When the Recolor Calculator is disabled and the MaskOverlay Calculator is enabled, I got a black screen.
Those logs do not show up when I use the Recolor Calculator. Expected result, when using the MaskOverlay calculator would be (edited on Gimp): |
@sureshdagooglecom |
Hi @jiuqiant , I'm looking forward to hearing from you :-) |
Hi @UnlimitedX ,
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you. |
Yes it works well.
Ok thanks, I'm currently doing some tests and I'll keep you updated about the progress. |
Hi @sureshdagooglecom Testing with same inputsI've tested the MaskOverlayCalculator with the same two inputs for testing purposes, which is the camera input:
I don't have a black screen and the camera is displayed. So I had a non-black output video in this case. Testing back with background videoWhen reverting back to my background video, the black screen returns.
Testing with background video + constant maskI've also tried using the constant mask and the black screen remains.
And the constant is injected like this: Testing with RecolorCalculator and the background videoSince the RecolorCalculator is working well with the camera input (scaled_input_video) and the segmentation mask, I've tried to replace the camera input by the background_video. Video format problem? (RGBA, encoding, or something else ? )I've tried multiple background videos and the problem remains the same. Thanks! |
Hi @jiuqiant @sureshdagooglecom , any news? |
Hi, I don't see anything obviously wrong here. It seems the combination of camera and video streams is causing an issue somewhere (but either by itself is OK). A few other things I can think to check are:
|
Hi @mcclanahoochie, I've tried simplifying the graph by removing the flow limiter calculators but the app crashes after a few seconds.
I've also added some logs following your advice. And it seems to be stuck before the "process 2 log". So that means mask_packet.IsEmpty() is true (I added a test directly in the if condition later to make sure it stops here). mask_packet should not be empty since it is working well with the RecolorCalculator (I tried again to make sure it's still working). But from what I understand, the video 1 should be at least displayed : Nevertheless, I still have a black background. - both the camera and video packets sent into the graph have the SAME timestamp, and are both valid each frame Could you please guide me through this process? Since the Camera feed is sent directly into the processor and the background feed is sent through consumable packets I don't know how to check the timestamps at the same place for both. Should I do it in the Process of the MaskCalculator? How the background feed is sent: The camera feed is set in the way given in the examples. Note: Looking forward to hearing from you! |
Hi @mcclanahoochie , Have you had a moment to check my previous post? Thank you very much. |
I don't think having two flow limiter calculators is necessary. Try using a packet cloner for background video instead:
The packet cloner will output a packet with every TICK signal. |
Hi @mcclanahoochie I realized I do have not the latest version of mediapipe and the TICK tag was added recently. With the ImmediateInputStreamHandler it crashed after 5 seconds of black screen. And without the black screen remained without crashing. Would you advise updating Mediapipe to its latest version? Thanks! |
Hi @mcclanahoochie , I've installed the latest version of Mediapipe today and compiled the graph with the exact same code you provided to me.
|
It's working with the ImmediateInputStreamHandler ! |
Hi @mcclanahoochie ,
I spotted the MaskOverlayCalculator / Packet::Getmediapipe::GpuBuffer() error so I thought it was because one stream or the other was starting too quickly and the other stream was not arriving fast enough (the background video was streaming from the network). Here is what I did without success : Looking forward to hearing from you! |
The error hints at a video packet being empty. Try checking for the VIDEO inputs to be not empty , similar to the mask here https://github.com/google/mediapipe/blob/6cdc6443b6a7ed662744e2a2ce2d58d9c83e6d6f/mediapipe/calculators/image/mask_overlay_calculator.cc#L111-L121 Just return ok status if input1_packet or input0_packet is empty. |
Hello @UnlimitedX, You can continue to use those legacy solutions in your applications if you choose. Though, we would request you to check new MediaPipe solutions which can help you more easily build and customize ML solutions for your applications. These new solutions will provide a superset of capabilities available in the legacy solutions. Thank you |
This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you. |
This issue was closed due to lack of activity after being marked stale for past 7 days. |
System information (Please provide as much relevant information as possible)
Describe the expected behavior:
I'd like to use the MaskOverlayCalculator node but I get a black screen as output.
My custom graph
I've customized the SelfieSegmentation GPU graph to be able to receive a background video.
I'm sending packets to the graph in Java using the VideoInput java class (solutioncore package).
videoBackgroundInput.setNewFrameListener(textureFrame -> { //Log.d("Segmenter", "New texture frame received"); Packet videoPacket = processor.getPacketCreator().createGpuBuffer(textureFrame); processor.getGraph().addConsumablePacketToInputStream(BACKGROUND_VIDEO_STREAM_NAME, videoPacket, textureFrame.getTimestamp()); videoPacket.release(); });
The background_video is properly displayed if I display it using the RecolorCalculator node. Same for the input_video.
But when I want to use the MaskOverlayCalculator, I get a black screen as output.
Here is the graph below with some comments.
Looking forward to hearing from you!
Thanks
The text was updated successfully, but these errors were encountered: