mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

models/hand_landmarker.task doesn't exist

Open fractalbob opened this issue 9 months ago • 8 comments

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

Yes

OS Platform and Distribution

Ubuntu 24.04.1 LTS

Python Version

3.9.7

MediaPipe Model Maker version

MediaPipe Tasks Vision library (which currently resolves to version 0.20230731).

Task name (e.g. Image classification, Gesture recognition etc.)

Hand Landmarker (Hand Tracking)

Describe the actual behavior

Calling setModelAssetPath("models/hand_landmarker.task") returns file not found

Describe the expected behaviour

models/hand_landmarker.task should exist

Standalone code/steps you may have used to try to get what you need

private void setupHandTracking() {         HandLandmarker.HandLandmarkerOptions options = HandLandmarker.HandLandmarkerOptions.builder()                 .setBaseOptions(BaseOptions.builder()                         .setModelAssetPath("models/hand_landmarker.task")  // ✅ Correct format with a subdirectory                         .build())                 .setRunningMode(RunningMode.LIVE_STREAM)                 .setResultListener((HandLandmarkerResult result, MPImage image) -> {                     // ✅ This callback is required when using LIVE_STREAM mode                     if (result != null && !result.landmarks().isEmpty()) {                         System.out.println("Detected hand landmarks: " + result.landmarks().get(0));                     }                 })                 .build();          // Debugging: Verify if the model file is available before initializing HandLandmarker         File modelFile = new File(getFilesDir(), "models/hand_landmarker.task");          if (!modelFile.exists()) {             Log.e("HandLandmarker", "❌ Model file NOT FOUND at: " + modelFile.getAbsolutePath());         } else {             Log.d("HandLandmarker", "✅ Model file FOUND at: " + modelFile.getAbsolutePath());         }          handLandmarker = HandLandmarker.createFromOptions(this, options);     }

Other info / Complete Logs


fractalbob avatar Mar 03 '25 15:03 fractalbob

Hi @fractalbob,

Could you please provide more details, including a complete, standalone code that can help us reproduce the issue on our end?

Thank you!!

kuaashish avatar Mar 04 '25 09:03 kuaashish

Here's a reproducible test case: https://drive.google.com/file/d/1MGRkQ0bWYMVKe25Dp5hug9oW9ZdjUR0A/view?usp=sharing. Unzip the file and open the resulting folder with Android Studio, then run the app. It should fail in MainActivity.java at line 207 with a SEGV fault because the file models/hand_landmarker.task doesn't exist.

fractalbob avatar Mar 06 '25 08:03 fractalbob

Hi @fractalbob,

Has this issue been resolved on your end, or do you require further assistance? Apologies for the delayed response. We were able to reproduce the issue using the steps and project zip file you provided. Please let us know your feedback.

Thank you!!

kuaashish avatar Mar 19 '25 07:03 kuaashish

Glad you were able to reproduce the problem. Have you found a solution? I've been waiting to hear back from you, since I haven't changed anything.

On Wed, Mar 19, 2025, 8:37 AM kuaashish @.***> wrote:

Hi @fractalbob https://github.com/fractalbob,

Has this issue been resolved on your end, or do you require further assistance? Apologies for the delayed response. We were able to reproduce the issue using the steps and project zip file you provided. Please let us know your feedback.

Thank you!!

— Reply to this email directly, view it on GitHub https://github.com/google-ai-edge/mediapipe/issues/5880#issuecomment-2735604771, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALTQDMLWWE7Y7OC34Q7OYD2VENFBAVCNFSM6AAAAABYHIS6KKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMZVGYYDINZXGE . You are receiving this because you were mentioned.Message ID: @.***> [image: kuaashish]kuaashish left a comment (google-ai-edge/mediapipe#5880) https://github.com/google-ai-edge/mediapipe/issues/5880#issuecomment-2735604771

Hi @fractalbob https://github.com/fractalbob,

Has this issue been resolved on your end, or do you require further assistance? Apologies for the delayed response. We were able to reproduce the issue using the steps and project zip file you provided. Please let us know your feedback.

Thank you!!

— Reply to this email directly, view it on GitHub https://github.com/google-ai-edge/mediapipe/issues/5880#issuecomment-2735604771, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALTQDMLWWE7Y7OC34Q7OYD2VENFBAVCNFSM6AAAAABYHIS6KKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMZVGYYDINZXGE . You are receiving this because you were mentioned.Message ID: @.***>

fractalbob avatar Mar 19 '25 08:03 fractalbob

Hi @fractalbob,

It appears there is an issue with the following dependency:

dependencies {
    implementation 'com.google.mediapipe:tasks-vision:latest.release'
}

The 'com.google.mediapipe:tasks-vision:latest.release' is currently pointing to version 0.20230731, which is outdated (released two years ago). We are aware of this and are working on removing it from the Maven repository. In the meantime, please update the dependency as follows:


dependencies {
    implementation 'com.google.mediapipe:tasks-vision:0.10.21'
}

Please try this and let us know the outcome. You may also refer to this issue for further understanding.

Let me know if this works!

kuaashish avatar Mar 19 '25 09:03 kuaashish

Hi, kuaashish,

Thanks for the suggestion, but the app is failing at the same place even with the update.

I should mention that I am currently running version 2024.3.1 (Meerkat) of Android Studio.

Regards,

Bob

On Wed, Mar 19, 2025, 10:16 AM kuaashish @.***> wrote:

Hi @fractalbob https://github.com/fractalbob,

It appears there is an issue with the following dependency:

dependencies { implementation 'com.google.mediapipe:tasks-vision:latest.release' }

The 'com.google.mediapipe:tasks-vision:latest.release' is currently pointing to version 0.20230731, which is outdated (released two years ago). We are aware of this and are working on removing it from the Maven repository. In the meantime, please update the dependency as follows:

dependencies { implementation 'com.google.mediapipe:tasks-vision:0.10.21' }

Please try this and let us know the outcome. You may also refer to this issue https://github.com/google-ai-edge/mediapipe/issues/5798 for further understanding.

Let me know if this works!

— Reply to this email directly, view it on GitHub https://github.com/google-ai-edge/mediapipe/issues/5880#issuecomment-2735843671, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALTQDIBE7A5JLV74XCRQUT2VEYW3AVCNFSM6AAAAABYHIS6KKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMZVHA2DGNRXGE . You are receiving this because you were mentioned.Message ID: @.***> [image: kuaashish]kuaashish left a comment (google-ai-edge/mediapipe#5880) https://github.com/google-ai-edge/mediapipe/issues/5880#issuecomment-2735843671

Hi @fractalbob https://github.com/fractalbob,

It appears there is an issue with the following dependency:

dependencies { implementation 'com.google.mediapipe:tasks-vision:latest.release' }

The 'com.google.mediapipe:tasks-vision:latest.release' is currently pointing to version 0.20230731, which is outdated (released two years ago). We are aware of this and are working on removing it from the Maven repository. In the meantime, please update the dependency as follows:

dependencies { implementation 'com.google.mediapipe:tasks-vision:0.10.21' }

Please try this and let us know the outcome. You may also refer to this issue https://github.com/google-ai-edge/mediapipe/issues/5798 for further understanding.

Let me know if this works!

— Reply to this email directly, view it on GitHub https://github.com/google-ai-edge/mediapipe/issues/5880#issuecomment-2735843671, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALTQDIBE7A5JLV74XCRQUT2VEYW3AVCNFSM6AAAAABYHIS6KKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMZVHA2DGNRXGE . You are receiving this because you were mentioned.Message ID: @.***>

fractalbob avatar Mar 19 '25 14:03 fractalbob

Hi @fractalbob,

Thank you for your response. There should be no issue with version 2024.3.1, as the minimum required version is 2021.1.1 (Bumblebee). I will attempt to look more into the issue again and provide you with an update.

kuaashish avatar Mar 19 '25 17:03 kuaashish

Thanks. I suggest you start by building the project I sent you, if you haven't already done that.

On Wed, Mar 19, 2025 at 6:14 PM kuaashish @.***> wrote:

Hi @fractalbob https://github.com/fractalbob,

Thank you for your response. There should be no issue with version 2024.3.1, as the minimum required version is 2021.1.1 (Bumblebee). I will attempt to look more into the issue again and provide you with an update.

— Reply to this email directly, view it on GitHub https://github.com/google-ai-edge/mediapipe/issues/5880#issuecomment-2737446614, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALTQDNIR3BQBYGY5SADU5L2VGQYFAVCNFSM6AAAAABYHIS6KKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMZXGQ2DMNRRGQ . You are receiving this because you were mentioned.Message ID: @.***> [image: kuaashish]kuaashish left a comment (google-ai-edge/mediapipe#5880) https://github.com/google-ai-edge/mediapipe/issues/5880#issuecomment-2737446614

Hi @fractalbob https://github.com/fractalbob,

Thank you for your response. There should be no issue with version 2024.3.1, as the minimum required version is 2021.1.1 (Bumblebee). I will attempt to look more into the issue again and provide you with an update.

— Reply to this email directly, view it on GitHub https://github.com/google-ai-edge/mediapipe/issues/5880#issuecomment-2737446614, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALTQDNIR3BQBYGY5SADU5L2VGQYFAVCNFSM6AAAAABYHIS6KKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMZXGQ2DMNRRGQ . You are receiving this because you were mentioned.Message ID: @.***>

fractalbob avatar Mar 19 '25 17:03 fractalbob