loadModel method
Future<bool>
loadModel({
- required String paramName,
- required String binName,
- int numClass = 1,
- int sizeId = 0,
- int cpuGpu = 0,
override
Load a PicoDet model from Android assets.
paramName - Name of the .param file in assets (e.g. "picodet.ncnn.param")
binName - Name of the .bin file in assets (e.g. "picodet.ncnn.bin")
numClass - Number of detection classes in the model
sizeId - Input size: 0=320, 1=400, 2=480, 3=560, 4=640
cpuGpu - Compute backend: 0=CPU, 1=GPU(Vulkan), 2=GPU(Turnip)
Implementation
@override
Future<bool> loadModel({
required String paramName,
required String binName,
int numClass = 1,
int sizeId = 0,
int cpuGpu = 0,
}) async {
final result = await methodChannel.invokeMethod<bool>('loadModel', {
'paramName': paramName,
'binName': binName,
'numClass': numClass,
'sizeId': sizeId,
'cpuGpu': cpuGpu,
});
return result ?? false;
}