Model

View Source On Gitee

import com.mindspore.lite.Model;

Model defines model in MindSpore Lite for managing graph.

Public Member Functions

function

boolean loadModel(Context context, String modelName)

boolean loadModel(String modelPath)

void freeBuffer()

void free()

loadModel

public boolean loadModel(Context context, String modelName)

Load the MindSpore Lite model from Assets.

  • Parameters

    • context: Context in Android.

    • modelName: Model file name.

  • Returns

    Whether the load is successful.

public boolean loadModel(String modelPath)

Load the MindSpore Lite model from path.

  • Parameters

    • modelPath: Model file path.

  • Returns

    Whether the load is successful.

freeBuffer

public void freeBuffer()

Free MetaGraph in MindSpore Lite Model to reduce memory usage during inference.

free

public void free()

Free all temporary memory in MindSpore Lite Model.