Skip to content
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

Android FrameProcessor method close() will crash #2150

Closed
solmate-james opened this issue Jun 9, 2021 · 9 comments
Closed

Android FrameProcessor method close() will crash #2150

solmate-james opened this issue Jun 9, 2021 · 9 comments
Assignees
Labels
legacy:face detection Issues related to Face Detection platform:android Issues with Android as Platform type:support General questions

Comments

@solmate-james
Copy link

solmate-james commented Jun 9, 2021

I use face detection and hair segmentation, both of which work when used alone.
My situation is that face detection is turned on in Activity, and there is a Bottom Navigation Bar at the bottom of the screen. When you click on it will switch Fragment.
After entering Fragment will turn on hair segmentation, but the App will crash.

com.google.mediapipe.framework.MediaPipeException: not found ValidatedGraphConfig Initialization failed
截圖 2021-06-09 下午3 17 13

I think the implementation of FrameProcessor is caused by singleton.
So I want to close the FrameProcessor before entering the Fragment
But it will crash directly when I call it.

截圖 2021-06-09 下午3 48 33

How do I use FrameProcessor close() well?

#1555 #580
I have confirmed the above two questions. It seems that they only use one model, so they can singleton FrameProcessor, but I have to set a different mobile_gpu.binarypb in new FrameProcessor(), the situation is different.

@sgowroji sgowroji self-assigned this Jun 9, 2021
@sgowroji sgowroji added platform:android Issues with Android as Platform stat:awaiting response Waiting for user response type:support General questions labels Jun 9, 2021
@sgowroji
Copy link

sgowroji commented Jun 9, 2021

I have found a similar issue, Could you please verify with this. If the reference doesn't work, please provide the below details.

Assuming the above issue is often due to finding the calculator dependencies. Can you provide all the steps to reproduce the above error. With respective details like android phone and its version.

@solmate-james
Copy link
Author

solmate-james commented Jun 10, 2021

@sgowroji
I think #1450 has no way to help me solve it. He seems to be misplaced aar.

I use a simple example to replicate the processor.close() crash problem.
https://github.com/jiuqiant/mediapipe_face_detection_aar_example
I cloned the above code, and only added a button to the xml. When I click it, I call processor.close() and it will crash.

activity_main.xml
Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="processor.close()"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

MainActvitiy.java
Button button = findViewById(R.id.button);
button.setOnClickListener(view -> {
if (processor != null) processor.close();
});

My Android phone is Samsung (Galaxy A8+), and the Android version is 9.0.
Thanks for your reply!

@sgowroji sgowroji assigned mcclanahoochie and jiuqiant and unassigned sgowroji Jun 10, 2021
@sgowroji sgowroji added stat:awaiting googler Waiting for Google Engineer's Response and removed stat:awaiting response Waiting for user response labels Jun 10, 2021
@jiuqiant jiuqiant assigned camillol and unassigned mcclanahoochie and jiuqiant Jun 14, 2021
@jiuqiant
Copy link
Contributor

@camillol knows the FrameProcessor better than @mcclanahoochie and me. It's better to ask @camillol to take a look.

@solmate-james
Copy link
Author

@camillol Could you help me~?

@ayushgdev ayushgdev assigned ayushgdev and unassigned camillol Apr 6, 2023
@ayushgdev ayushgdev added legacy:face detection Issues related to Face Detection and removed stat:awaiting googler Waiting for Google Engineer's Response labels Apr 6, 2023
@ayushgdev
Copy link
Contributor

@solmate-james Are you still looking for a resolution?

@ayushgdev ayushgdev added the stat:awaiting response Waiting for user response label Apr 6, 2023
@google-ml-butler
Copy link

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.

@google-ml-butler
Copy link

Closing as stale. Please reopen if you'd like to work on this further.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@ayushgdev ayushgdev removed stat:awaiting response Waiting for user response stalled labels Apr 24, 2023
@huongdemo
Copy link

I've had the same problem before, hope someone has the best solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy:face detection Issues related to Face Detection platform:android Issues with Android as Platform type:support General questions
Projects
None yet
Development

No branches or pull requests

7 participants