Commit graph

635 commits

Author SHA1 Message Date
laurenspriem
1cd31d2cab [mob][photos] Only decode image once for face thumbnails in file info 2024-04-30 10:46:16 +05:30
laurenspriem
8b1545239c [mob][photos] Use canvas again for generating face thumbnail 2024-04-29 16:28:19 +05:30
laurenspriem
aad1327705 [mob][photos] Small cleanup 2024-04-29 15:29:00 +05:30
laurenspriem
8058c6b621 [mob][photos] Remove unnecessary write transactions 2024-04-29 15:20:01 +05:30
laurenspriem
d03d8d564d [mob][photos] Fix DB issue 2024-04-29 15:13:51 +05:30
laurenspriem
87571159cc [mob][photos] Fix faces db conflict 2024-04-27 14:30:34 +05:30
laurenspriem
97d8c5f83e Merge remote-tracking branch 'origin/mobile_face' into mobile_face 2024-04-27 14:03:40 +05:30
laurenspriem
a2023bd457 [mob][photos] Fix database issue 2024-04-27 13:38:34 +05:30
ashilkn
54d3ad9743 [mob][photos] Remove unnecessary optional parameter 2024-04-27 12:37:42 +05:30
laurenspriem
6235f7ee78 [mob][photos] Move FaceBoxImage to face_util 2024-04-27 12:19:29 +05:30
Laurens Priem
9eeab36392
[mob][photos] Generate face crops faster (#1542)
## Description

Have written two new methods, `generateImgFaceThumbnails()` and
`generateJpgFaceThumbnails()`.
Using `generateJpgFaceThumbnails()` now since it returns
`Future<List<Uint8List>>` and is easier to integrate within the code
base because the return type remains the same with the older
`generateFaceThumbnailsForImage()`

There is performance improvement with `generateImgFaceThumbnails()`, but
it's not very significant and it requires changes in codebase to work
with it's return type `Future<List<Image>>` (`Image` from the `Image`
package). Can consider using it if it feels necessary in future.

If multiple faces are being generated from the same image, the image can
be decoded once and passed to `generateImgFaceThumbnails()` or
`generateJpgFaceThumbnails()` to avoid repeated decoding of the same
image.

`generateImgFaceThumbnails()` and `generateJpgFaceThumbnails()` uses the
isolates available from the pool of 4 spawned by `Computer` and
processes multiple faces in parallel unlike
`generateImgFaceThumbnails()`, which processes only one at a time.
2024-04-27 12:05:32 +05:30
laurenspriem
f422e30a8e [mob][photos] Migrate fully to sqlite async for faces, removing sqflite fully 2024-04-27 11:13:52 +05:30
ashilkn
58cd9350c0 Merge branch 'mobile_face' into fix_face_thumbnail 2024-04-27 11:10:10 +05:30
ashilkn
ab5985a08b [mob][photos] Use generated face crops and crop it using the new method 2024-04-27 11:06:54 +05:30
ashilkn
19f2c5f00a [mob][photos] remove negation 2024-04-27 11:02:38 +05:30
ashilkn
707916f677 [mob][photos] Add method to convert Image from Image package to UI image 2024-04-27 10:57:49 +05:30
ashilkn
8b236cde09 [mob][photos] When cropping a face from an image, make the image a square and add some buffer around it 2024-04-27 09:59:16 +05:30
laurenspriem
968eaaf5f6 [mob][photos] Better error logging 2024-04-27 09:39:12 +05:30
ashilkn
caa72ba830 [mob][photos] add option to pass decoded image to face thumbnail generation methods to avoid unnecessary decoding when possible 2024-04-26 15:44:07 +05:30
laurenspriem
2692d0a34f [mob][photos] Fix issue in displaying face thumbnails for videos 2024-04-26 14:50:14 +05:30
laurenspriem
44898415e7 [mob][photos] Index videos using thumbnails 2024-04-26 14:43:19 +05:30
laurenspriem
811ffe0117 [mob][photos] Create new cluster when tapping unassigned face 2024-04-26 14:13:00 +05:30
laurenspriem
43f01c31da [mob][photos] Prevent sqlite disk corruption issue 2024-04-26 12:58:27 +05:30
ashilkn
a0e9913f43 Revert "[mob] Crop image instead of using scale and translate transforms on OG image in CroppedFaceImageView widget"
This reverts commit b022ef6d1e.
2024-04-26 12:56:12 +05:30
ashilkn
b256bb2757 Revert "[mob] perf: Decode images from which face is to be cropped, in an isolate to avoid jank"
This reverts commit 2f7e0cd1ef.
2024-04-26 12:55:29 +05:30
ashilkn
3eebfdd037 Revert "[mob] Two varients of CroppedFaceImageView for testing out which is more performant"
This reverts commit 7617817798.
2024-04-26 12:54:29 +05:30
ashilkn
a577611e65 [mob] merge mobile_face to fix_face_thumbnail 2024-04-26 11:32:33 +05:30
laurenspriem
b2a2078045 [mob][photos] Moving more methods to sqlite async 2024-04-25 17:06:40 +05:30
ashilkn
7617817798 [mob] Two varients of CroppedFaceImageView for testing out which is more performant 2024-04-25 16:58:58 +05:30
ashilkn
f173bc4038 [mob] Wrote util methods to generate face thumbnails from an image path
Need to decide on which util method to use of the two after performance testing
2024-04-25 16:56:43 +05:30
laurenspriem
3828fa328e [mob][photos] Increase conservative clustering threshold slightly 2024-04-25 16:41:23 +05:30
laurenspriem
f101468a8d [mob][photos] Show faces in file info regardless of blur value 2024-04-25 16:30:00 +05:30
laurenspriem
52a7f2753e [mob][photos] Tiny change 2024-04-25 16:15:04 +05:30
laurenspriem
7fd5ffc0e6 [mob][photos] Forgot method 2024-04-25 16:14:16 +05:30
laurenspriem
43cbfbfa33 [mob][photos] Automatically reject overlapping suggestions 2024-04-25 16:13:29 +05:30
laurenspriem
7370557b08 [mob][photos] More use of sqlite async 2024-04-25 15:41:26 +05:30
laurenspriem
f0ebdb211c [mob][photos] Functionality to remove selected images from suggestion 2024-04-25 14:13:58 +05:30
ashilkn
2f7e0cd1ef [mob] perf: Decode images from which face is to be cropped, in an isolate to avoid jank 2024-04-25 12:29:29 +05:30
laurenspriem
d429efaf14 [mob][photos] Trailing commas 2024-04-25 12:19:19 +05:30
laurenspriem
7b8816a4bf [mob][photos] Higher conservative clustering threshold 2024-04-25 10:54:49 +05:30
laurenspriem
7e00a470aa [mob][photos] Lower both hard and soft blur thresholds 2024-04-25 10:54:19 +05:30
laurenspriem
1ae4482fe5 [mob][photos] Always check big clusters first for suggestions 2024-04-25 10:53:42 +05:30
laurenspriem
d0420ce477 [mob][photos] Better sorting of faces in file info 2024-04-25 10:03:05 +05:30
ashilkn
b022ef6d1e [mob] Crop image instead of using scale and translate transforms on OG image in CroppedFaceImageView widget 2024-04-25 09:35:55 +05:30
laurenspriem
244d562207 [mob][photos] Increase the pool for face thumbnail generation 2024-04-25 08:50:44 +05:30
laurenspriem
3fbfa8c0e6 [mob][photos] Precompute face thumbnails for suggestions 2024-04-24 18:59:08 +05:30
laurenspriem
6f6f976dec [mob][photos] Fix bug 2024-04-24 18:33:00 +05:30
laurenspriem
07458fb247 [mob][photos] Recompute suggestions on rejected suggestion 2024-04-24 17:15:11 +05:30
laurenspriem
72ff6e2cf3 [mob][photos] Tiny change 2024-04-24 17:07:28 +05:30
laurenspriem
e0fbb2620b [mob][photos] Correct suggestion logic again 2024-04-24 17:06:35 +05:30