[mob][onnx] Specify return type
This commit is contained in:
@@ -142,7 +142,7 @@ class FaceDetectionService extends MlModel {
|
||||
"YOLO_FACE",
|
||||
);
|
||||
final List<List<List<double>>> reconstructedTensor = [];
|
||||
for (int i = 0; i < result.length; i += 25200 * 16) {
|
||||
for (int i = 0; i < result!.length; i += 25200 * 16) {
|
||||
final List<List<double>> outerArray = [];
|
||||
for (int j = 0; j < 25200; j++) {
|
||||
final List<double> innerArray =
|
||||
|
||||
@@ -16,7 +16,7 @@ class OnnxDart {
|
||||
.init(modelType, modelPath, sessionsCount: sessionsCount);
|
||||
}
|
||||
|
||||
Future<dynamic?> predict(
|
||||
Future<Float32List?> predict(
|
||||
Float32List inputData,
|
||||
String modelType, {
|
||||
int sessionAddress = 0,
|
||||
|
||||
@@ -37,31 +37,13 @@ class MethodChannelOnnxDart extends OnnxDartPlatform {
|
||||
return result;
|
||||
}
|
||||
|
||||
// @override
|
||||
// Future<List<double>?> predict(
|
||||
// List<double> inputData,
|
||||
// String modelType, {
|
||||
// int sessionAddress = 0,
|
||||
// }) async {
|
||||
// final List<dynamic>? result =
|
||||
// await methodChannel.invokeMethod<List<double>?>(
|
||||
// 'predict',
|
||||
// {
|
||||
// 'sessionAddress': sessionAddress,
|
||||
// 'inputData': inputData,
|
||||
// 'modelType': modelType,
|
||||
// },
|
||||
// );
|
||||
// return result!.cast<double>();
|
||||
// }
|
||||
|
||||
@override
|
||||
Future<dynamic?> predict(
|
||||
Future<Float32List?> predict(
|
||||
Float32List inputData,
|
||||
String modelType, {
|
||||
int sessionAddress = 0,
|
||||
}) {
|
||||
return methodChannel.invokeMethod<dynamic?>(
|
||||
return methodChannel.invokeMethod<Float32List?>(
|
||||
'predict',
|
||||
{
|
||||
'sessionAddress': sessionAddress,
|
||||
|
||||
@@ -41,7 +41,7 @@ abstract class OnnxDartPlatform extends PlatformInterface {
|
||||
throw UnimplementedError('release() has not been implemented.');
|
||||
}
|
||||
|
||||
Future<dynamic?> predict(
|
||||
Future<Float32List?> predict(
|
||||
Float32List inputData,
|
||||
String modelType, {
|
||||
int sessionAddress = 0,
|
||||
|
||||
Reference in New Issue
Block a user