Skip to content

models/hand_landmarker.task doesn't exist #5880

Open
@fractalbob

Description

@fractalbob

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

Metadata

Metadata

Assignees

Labels

os:linux-non-armIssues on linux distributions which run on x86-64 architecture. DOES NOT include ARM devices.platform:pythonMediaPipe Python issuestype:modelmakerIssues related to creation of custom on-device ML solutionstype:supportGeneral questions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions