Skip to content

Commit 415e3b0

Browse files
authored
feat: port classification module to C++ (#363)
## Description Port classification module to native C++ code. ### Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update (improves or adds clarity to existing documentation) ### Tested on - [x] iOS - [x] Android ### Related issues #255 #257 ### Checklist - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [x] My changes generate no new warnings
1 parent beb7c38 commit 415e3b0

53 files changed

Lines changed: 169 additions & 1285 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/computer-vision/screens/ClassificationScreen.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export const ClassificationScreen = ({
3434
try {
3535
const output = await model.forward(imageUri);
3636
const top10 = Object.entries(output)
37-
.sort(([, a], [, b]) => b - a)
37+
.sort(([, a], [, b]) => (b as number) - (a as number))
3838
.slice(0, 10)
39-
.map(([label, score]) => ({ label, score }));
39+
.map(([label, score]) => ({ label, score: score as number }));
4040
setResults(top10);
4141
} catch (e) {
4242
console.error(e);
-694 KB
Binary file not shown.
-694 KB
Binary file not shown.

ios/libs/libbackend_coreml_ios.a

-757 KB
Binary file not shown.
-757 KB
Binary file not shown.
-314 KB
Binary file not shown.
-313 KB
Binary file not shown.

ios/libs/libbackend_mps_ios.a

-403 KB
Binary file not shown.
-402 KB
Binary file not shown.
-2.22 MB
Binary file not shown.

0 commit comments

Comments
 (0)