Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob] Pass correct ml version

Neeraj Gupta52d1ba237a42
diff --git a/mobile/lib/services/machine_learning/ml_result.dart b/mobile/lib/services/machine_learning/ml_result.dart
index 9385639ee8..3f0aab4784 100644
--- a/mobile/lib/services/machine_learning/ml_result.dart
+++ b/mobile/lib/services/machine_learning/ml_result.dart
@@ -2,7 +2,6 @@ import "dart:convert" show jsonEncode, jsonDecode;
import "package:photos/models/ml/face/dimension.dart";
import 'package:photos/models/ml/ml_typedefs.dart';
-import "package:photos/models/ml/ml_versions.dart";
import 'package:photos/services/machine_learning/face_ml/face_alignment/alignment_result.dart';
import 'package:photos/services/machine_learning/face_ml/face_detection/detection.dart';
import 'package:photos/services/machine_learning/face_ml/face_filtering/face_filtering_constants.dart';
@@ -15,7 +14,6 @@ class MLResult {
Dimensions decodedImageSize;
- int mlVersion;
bool errorOccured;
bool onlyThumbnailUsed;
@@ -29,7 +27,6 @@ class MLResult {
this.fileId = -1,
this.faces = const <FaceResult>[],
this.clip,
- this.mlVersion = faceMlVersion,
this.errorOccured = false,
this.onlyThumbnailUsed = false,
this.decodedImageSize = const Dimensions(width: -1, height: -1),
@@ -37,7 +34,6 @@ class MLResult {
MLResult.fromEnteFileID(
fileID, {
- this.mlVersion = faceMlVersion,
this.errorOccured = false,
this.onlyThumbnailUsed = false,
this.decodedImageSize = const Dimensions(width: -1, height: -1),
@@ -56,7 +52,6 @@ class MLResult {
'fileId': fileId,
'faces': faces?.map((face) => face.toJson()).toList(),
'clip': clip?.toJson(),
- 'mlVersion': mlVersion,
'errorOccured': errorOccured,
'onlyThumbnailUsed': onlyThumbnailUsed,
'decodedImageSize': {
@@ -78,7 +73,6 @@ class MLResult {
clip: json['clip'] != null
? ClipResult.fromJson(json['clip'] as Map<String, dynamic>)
: null,
- mlVersion: json['mlVersion'],
errorOccured: json['errorOccured'] ?? false,
onlyThumbnailUsed: json['onlyThumbnailUsed'] ?? false,
decodedImageSize: json['decodedImageSize'] != null
diff --git a/mobile/lib/services/machine_learning/ml_service.dart b/mobile/lib/services/machine_learning/ml_service.dart
index 48a5d64ea5..66581085fe 100644
--- a/mobile/lib/services/machine_learning/ml_service.dart
+++ b/mobile/lib/services/machine_learning/ml_service.dart
@@ -15,6 +15,7 @@ import "package:photos/models/ml/face/box.dart";
import "package:photos/models/ml/face/detection.dart" as face_detection;
import "package:photos/models/ml/face/face.dart";
import "package:photos/models/ml/face/landmark.dart";
+import "package:photos/models/ml/ml_versions.dart";
import "package:photos/service_locator.dart";
import "package:photos/services/filedata/filedata_service.dart";
import "package:photos/services/filedata/model/file_data.dart";
@@ -459,7 +460,7 @@ class MLService {
dataEntity.putFace(
RemoteFaceEmbedding(
faces,
- result.mlVersion,
+ faceMlVersion,
client: client,
height: result.decodedImageSize.height,
width: result.decodedImageSize.width,
@@ -470,7 +471,7 @@ class MLService {
dataEntity.putClip(
RemoteClipEmbedding(
result.clip!.embedding,
- version: result.mlVersion,
+ version: clipMlVersion,
client: client,
),
);