Skip to content

Commit

Permalink
perf(tensor): add sharp async image decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Aug 5, 2023
1 parent f9d61e3 commit 161ded2
Show file tree
Hide file tree
Showing 42 changed files with 352 additions and 33 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .yarn/install-state.gz
Binary file not shown.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@a11ywatch/mav",
"version": "0.7.24",
"version": "0.7.27",
"description": "a gRPC image recognition service",
"main": "./server.js",
"scripts": {
Expand All @@ -25,9 +25,9 @@
"@tensorflow/tfjs-backend-wasm": "^4.9.0",
"@tensorflow/tfjs-converter": "^4.9.0",
"@tensorflow/tfjs-core": "^4.9.0",
"base64-to-tensor": "^1.2.12",
"jpeg-js": "^0.4.4",
"tensornet": "^1.0.17"
"base64-to-tensor": "^1.2.16",
"sharp": "^0.32.4",
"tensornet": "^1.0.21"
},
"devDependencies": {
"@swc/core": "^1.2.197",
Expand Down
4 changes: 2 additions & 2 deletions src/ai/detectImage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { classify } from "tensornet";
import { classifyAsync } from "tensornet";
import { computerVision } from "./azure/azure-detect-image";
import { chainNextClassifier } from "../utils/chain-next";
import { confidentCaptions } from "../utils/confidence";
Expand All @@ -11,7 +11,7 @@ export const detectImageModel = async (
let predictions = [];

try {
const classification = config.img && (await classify(config.img));
const classification = config.img && (await classifyAsync(config.img));
if (classification && classification?.length) {
predictions = classification;
}
Expand Down
Loading

0 comments on commit 161ded2

Please sign in to comment.