Commit graph

25304 commits

Author SHA1 Message Date
Manav Rathi e57e44c139
Inline 2024-04-11 12:14:59 +05:30
Manav Rathi 6ba5852876
Prune 2024-04-11 12:10:02 +05:30
Manav Rathi 38e9e901f6
Inline 2024-04-11 12:06:50 +05:30
Manav Rathi 79a975a281
Remove various unused util methods 2024-04-11 12:05:09 +05:30
Manav Rathi ce566f522d
Prune 2024-04-11 11:59:36 +05:30
Manav Rathi d2e7925c63
Prune 2024-04-11 11:47:07 +05:30
Manav Rathi 006ea085fe
Prune 2024-04-11 11:43:05 +05:30
Manav Rathi 03df858dcc
Remove ssdMobileNetV2 2024-04-11 11:23:23 +05:30
Manav Rathi da3b58661a
Remove blazeface 2024-04-11 11:21:19 +05:30
Manav Rathi e6905577c6
Remove blazeface-back 2024-04-11 11:17:15 +05:30
Manav Rathi e7902c5d83
Remove more tf 2024-04-11 11:15:15 +05:30
Manav Rathi 3182d67ca1
Remove tf utils 2024-04-11 11:13:52 +05:30
Manav Rathi 1ad5cb83f9
Remove object detection related code 2024-04-11 11:09:32 +05:30
Manav Rathi b6e1c4d3da
Inline 2024-04-10 21:36:43 +05:30
Manav Rathi 0ee416c91b
git rm -r apps/photos/public/js/{tesseract,tfjs,tflite} 2024-04-10 21:32:22 +05:30
Manav Rathi 3e8d88caf2
git rm -r apps/photos/public/models 2024-04-10 21:31:06 +05:30
Manav Rathi 52342a23cb
Remove tensorflow packages
yarn workspace photos remove "@tensorflow-models/coco-ssd" "@tensorflow/tfjs-backend-cpu" "@tensorflow/tfjs-backend-webgl" "@tensorflow/tfjs-converter" "@tensorflow/tfjs-core" "@tensorflow/tfjs-tflite"
2024-04-10 21:29:23 +05:30
Manav Rathi f6c47138e1
Addedfaq-v1 (#1404) 2024-04-10 21:13:51 +05:30
Manav Rathi 549ad77ac6
[desktop] Various improvements (#1407)
- Restore macOS icon
- Remove unnecessary require
- Spruce dependencies docs
- Use standard import for jpeg-js
- Rearrange files
- Import onnxruntime with TypeScript types
2024-04-10 21:13:01 +05:30
Manav Rathi 500022d4b9
Import onnxruntime with TypeScript types
Refs:
- https://github.com/microsoft/onnxruntime/issues/17979
2024-04-10 21:01:30 +05:30
Manav Rathi 2da9565dcb
Rearrange files 2024-04-10 20:44:52 +05:30
Manav Rathi 8f8d93d11e
Use standard import for jpeg-js 2024-04-10 20:36:46 +05:30
Manav Rathi 008b6d5186
Spruce dependencies docs 2024-04-10 20:36:46 +05:30
Manav Rathi d913cbeae5
Remove unnecessary require 2024-04-10 20:32:32 +05:30
Manav Rathi 11451efffd
Restore macOS icon
git checkout 42679bc9daa4108681683079f4cb1f2832f4578c~ -- build/icon.icns
2024-04-10 20:32:32 +05:30
Manav Rathi 66c06c7601
[desktop] Build ARM64 variant of Windows (#1405)
Fixes https://github.com/ente-io/ente/issues/1374

A customer reported that the app fails to run on Windows ARM. The error
is coming when trying to load ONNX.

ONNX runtime supports Windows ARM, e.g. see
-
https://www.jsdelivr.com/package/npm/onnxruntime-node?tab=files&path=bin%2Fnapi-v3%2Fwin32
- https://github.com/microsoft/onnxruntime/issues/18078

The issue then seems to be that we're not actually building for Windows
ARM. I'm not sure about this (don't have a Windows ARM machine at hand),
but my theory is that since we don't ask Electron Builder to build for
win arm64, it doesn't copy the corresponding ONNX binary into the
generated bundle.

Other refs:
- https://www.electron.build/cli.html
2024-04-10 19:34:35 +05:30
Manav Rathi ecf40a70cf
[desktop] Build ARM64 variant of Windows
Fixes https://github.com/ente-io/ente/issues/1374

A customer reported that the app fails to run on Windows ARM. The error is
coming when trying to load ONNX.

ONNX runtime supports Windows ARM, e.g. see
- https://www.jsdelivr.com/package/npm/onnxruntime-node?tab=files&path=bin%2Fnapi-v3%2Fwin32
- https://github.com/microsoft/onnxruntime/issues/18078

The issue then seems to be that we're not actually building for Windows ARM. I'm
not sure about this (don't have a Windows ARM machine at hand), but my theory is
that since we don't ask Electron Builder to build for win arm64, it doesn't copy
the corresponding ONNX binary into the generated bundle.

Other refs:
- https://www.electron.build/cli.html
2024-04-10 19:33:37 +05:30
Manav Rathi 4a69e9260c
[web] Import the scaffolding to sync face embeddings from web_face_v2 (#1402)
This PR cherry picks Neeraj's ML related changes from the web_face_v2
branch.

Similar to https://github.com/ente-io/ente/pull/1399, this gets us one
step closer to integrating ONNX-YOLO with our desktop app. But it is not
currently in a usable state (The web app's functionality remains
untouched).
2024-04-10 16:53:48 +05:30
Manav Rathi 18937581a5
Lint fixes 2024-04-10 16:41:26 +05:30
Neeraj Gupta eefac7fd01
[web] Import the scaffolding to sync face embeddings from web_face_v2
This PR cherry picks Neeraj's ML related changes from the web_face_v2 branch.

Similar to https://github.com/ente-io/ente/pull/1399, this gets us one step
closer to integrating ONNX-YOLO with our desktop app. But it is not currently in
a usable state (The web app's functionality remains untouched).
2024-04-10 16:38:12 +05:30
Manav Rathi 334fd61ea3
[desktop] Code tweaks (#1401)
- Remove top level wrapper
- Document the tray icon
- Update to the new product name where possible
2024-04-10 16:30:54 +05:30
Ashil 3542c8eeff
[Mobile][Photos] Bump up version to 0.8.78 (#1400) 2024-04-10 16:10:54 +05:30
Manav Rathi c73c674ee4
Update to the new product name where possible
(without breaking auto-updates)
2024-04-10 16:07:25 +05:30
Manav Rathi e57e6845a5
Product name 2024-04-10 16:06:04 +05:30
Manav Rathi 3123caea92
Document the tray icon 2024-04-10 16:05:52 +05:30
Manav Rathi 4e3cce51de
Inline 2024-04-10 15:59:57 +05:30
Manav Rathi 127bb9988f
Remove top level wrapper 2024-04-10 15:55:58 +05:30
Manav Rathi 6fc82ff062
[web] Import ONNX-YOLO face changes from the web_face branch (#1399)
Laurens has made the relevant changes to get ONNX-YOLO face detection
working in a manner where the generated embeddings are the same as what
get generated by the corresponding ML stack in the mobile client.

This PR cherry picks his ML related changes from the branch he was
working in, but leaves out the surrounding scaffolding (We cannot merge
that branch directly because it relies on wasm that we don't need and
don't want to commit to main).

At this point this functionality is correct but not usable - the next
step will be to tie this to the ONNX runtime that we already have on the
Node.js layer of our desktop app.

**Tests**

- yarn dev + smoke test
- yarn build + smoke test
- yarn lint
2024-04-10 15:36:03 +05:30
Manav Rathi 45d22d5863
Undo concurrency change 2024-04-10 15:34:21 +05:30
Vishnu Mohandas b8be65862f
Use sqlite async for fetching files for gallery (#1397)
## Description

- Migrated from `sqflite` to `sqlite_async` when fetching files for
gallery (Home gallery, Collections page, Archive page & Add photos sheet
gallery ). This has made gallery load significantly faster and has
gotten rid of logs like `NativeAlloc concurrent copying GC freed
392872(19MB) AllocSpace objects, 139(4024KB) LOS objects, 38% free,
38MB/62MB, paused 2.868ms,93us total 324.898ms`. The initial load(100
files) and final load completes instantaneously even before the user
starts interacting with the app which has gotten rid of the jank which
was present before on the final load.
- In the 'Add Photos sheet', it takes time for the gallery to load when
using `sqflite` and images are rendered after this delay. After
migrating to `sqlite_async`, since the gallery loads instantly and
images are rendered right after, the animation of the bottom sheet
coming up became a bit janky. To make it smooth, have added a delay to
load gallery only after the bottom sheet is up fully.
 

## Tests
- [x] Did basic testing to make sure the migrations are working fine.
2024-04-10 15:34:06 +05:30
ashilkn 5879f5ed06 Merge branch 'main' into use_sqlite_async_for_fetching_files_for_gallery 2024-04-10 15:24:23 +05:30
Manav Rathi 71e839e9c4
Remove unused minFaceSize 2024-04-10 14:52:23 +05:30
laurenspriem 3eb95bd822
Import ONNX-YOLO face changes from the web_face branch
Laurens has made the relevant changes to get ONNX-YOLO face detection working in
a manner where the generated embeddings are the same as what get generated by
the corresponding ML stack in the mobile client.

This commit cherry picks his ML related changes from the branch he was working
in, but leaves out the surrounding scaffolding (We cannot merge that branch
directly because it relies on wasm that we don't need and don't want to commit
to main).

At this point this functionality is correct but not usable - the next step will
be to tie this to the ONNX runtime that we already have on the Node.js layer of
our desktop app.
2024-04-10 14:41:59 +05:30
Manav Rathi 03176911ee
[web] [desktop] Refactoring IPC (#1398)
- IPC cleanup and refactoring
- Log on unhandled errors and promise rejections
2024-04-10 14:08:07 +05:30
Manav Rathi 6ec4cc7c89
Log unhandled errors and promise rejections in the desktop app
Test code:

    setTimeout(() => testFunctionSync(), 5000);
    setTimeout(
        () => testFunction().then(() => console.log("done testFunction")),
        10000,
    );

    const testFunctionSync = () => {
        console.log("sleeping not");
        throw new Error("Handle me");
    };

    const testFunction = async () => {
        console.log("sleeping");
        await fs.mkdir("/tmp/foo", { recursive: true });
        console.log("woke up");
        throw new Error("Handle me");
    };
2024-04-10 13:35:04 +05:30
Manav Rathi 5eda8fd464
Log in other apps too 2024-04-10 13:09:14 +05:30
Manav Rathi e0fe018f34
Log on unhandled errors and promise rejections
Test code:

    useEffect(() => {
        setTimeout(() => testFunctionSync(), 5000);
    }, []);

    useEffect(() => {
        testFunction();
    }, []);

    const testFunctionSync = () => {
        console.log("sleeping not");
        // sleep(2000);
        console.log("woke up not");
        throw new Error("Handle me");
    };

    const testFunction = async () => {
        console.log("sleeping");
        sleep(2000);
        console.log("woke up");
        throw new Error("Handle me");
    };

Refs:
- https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event
- https://github.com/megahertz/electron-log/blob/master/src/renderer/lib/RendererErrorHandler.js
2024-04-10 13:05:00 +05:30
Manav Rathi af79f4f0c9
Audit app update functions 2024-04-10 12:32:43 +05:30
ashilkn d07c4f4d1d Remove code used for debugging/testing 2024-04-10 12:29:01 +05:30
ashilkn 7759d6dcc9 Call super.initState() first in override of initState() in Gallery Widget 2024-04-10 11:47:54 +05:30