[mob][photos] Logging
This commit is contained in:
@@ -60,8 +60,6 @@ class FaceEmbeddingService extends MlModel {
|
||||
Float32List input,
|
||||
int sessionAddress,
|
||||
) {
|
||||
final stopwatch = Stopwatch()..start();
|
||||
_logger.info('MobileFaceNet interpreter.run is called');
|
||||
final runOptions = OrtRunOptions();
|
||||
final int numberOfFaces = input.length ~/ (kInputSize * kInputSize * 3);
|
||||
final inputOrt = OrtValueTensor.createTensorWithDataList(
|
||||
@@ -78,11 +76,9 @@ class FaceEmbeddingService extends MlModel {
|
||||
}
|
||||
inputOrt.release();
|
||||
runOptions.release();
|
||||
outputs.forEach((element) => element?.release());
|
||||
stopwatch.stop();
|
||||
_logger.info(
|
||||
'MobileFaceNetFFI interpreter.run is finished, in ${stopwatch.elapsedMilliseconds}ms',
|
||||
);
|
||||
for (var element in outputs) {
|
||||
element?.release();
|
||||
}
|
||||
|
||||
return embeddings;
|
||||
}
|
||||
|
||||
@@ -34,11 +34,13 @@ Future<(Image, ByteData)> decodeImageFromPath(String imagePath) async {
|
||||
final String? jpgPath =
|
||||
await HeifConverter.convert(imagePath, format: 'jpg');
|
||||
if (jpgPath != null) {
|
||||
_logger.info('Conversion successful, decoding JPG');
|
||||
final imageData = await File(jpgPath).readAsBytes();
|
||||
final image = await decodeImageFromData(imageData);
|
||||
final ByteData imageByteData = await getByteDataFromImage(image);
|
||||
return (image, imageByteData);
|
||||
}
|
||||
_logger.info('Unable to convert $format to JPG');
|
||||
}
|
||||
_logger.severe(
|
||||
'Error decoding image of format $format (Android: ${Platform.isAndroid})',
|
||||
|
||||
Reference in New Issue
Block a user