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 b3aed82
Show file tree
Hide file tree
Showing 41 changed files with 351 additions and 22 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 modified .yarn/install-state.gz
Binary file not shown.
6 changes: 3 additions & 3 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.26",
"description": "a gRPC image recognition service",
"main": "./server.js",
"scripts": {
Expand All @@ -25,8 +25,8 @@
"@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",
"base64-to-tensor": "^1.2.15",
"sharp": "^0.32.4",
"tensornet": "^1.0.17"
},
"devDependencies": {
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 b3aed82

Please sign in to comment.