onDeviceModel error

  • A brief summary of the issue you’re encountering:
    When trying to follow the Fritz AI Studio guide, step 4: Testing a Model in an App, I encounter errors in the code. I already have a model made and trained it in the Studio, and am attempting to input it into the example Pose Estimation app provided on Github.

  • The version of the Fritz SDK, testing device, and Android API used (e.g Fritz v5.0.1, Samsung Galaxy S7, API 29):
    Fritz core and vision 6.00
    Google Pixel 3 XL
    API 29

  • Any relevant code snippets that exemplify the issue:
    FritzVisionPosePredictor predictor = new FritzVisionPosePredictor(onDeviceModel);

  • Any important or relevant context about the code snippet and/or the solution you’re seeking:
    Error on onDeviceModel.
    I’ve defined it as a new PoseOnDeviceModel as per the Model Setup Instructions in the Models page of the Fritz Studio.

  • Any relevant error messages/logs:
    FritzVisionPosePredictor (PoseOnDeviceModel, FritzVisionPosePredictorOptions) in FritzVisionPosePredictor cannot be applied to (PoseOnDeviceModel)

Hello, sorry you are experiencing this issue.

Can you please provide the code you are using to create the onDeviceModel?

Thanks!

PoseOnDeviceModel onDeviceModel = new PoseOnDeviceModel(
        "file:///android_asset/PoseEstimationFast1590883271.tflite",
        "bb52d6cd8374421187b12a377c89175e",
        2, // model version number
        new CustomSkeleton(),
        8,  // typically 8
        false // required for custom models
);

It looks like you’re using the constructor directly from FritzVisionPosePredictor. Can you try using the static method from FritzVision to declare the predictor?

PoseOnDeviceModel poseEstimationOnDeviceModel = ...;
FritzVisionPosePredictorOptions options = new FritzVisionPosePredictorOptions();
        options.minPartThreshold = 0.1f;
        options.minPoseThreshold = 0.1f;
FritzVisionPosePredictor predictor = FritzVision.PoseEstimation.getPredictor(poseEstimationOnDeviceModel, options);

Let us know if that works.