diff --git a/.husky/_/post-checkout b/.husky/_/post-checkout new file mode 100755 index 0000000..ca7fcb4 --- /dev/null +++ b/.husky/_/post-checkout @@ -0,0 +1,3 @@ +#!/bin/sh +command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-checkout' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; } +git lfs post-checkout "$@" diff --git a/.husky/_/post-commit b/.husky/_/post-commit new file mode 100755 index 0000000..52b339c --- /dev/null +++ b/.husky/_/post-commit @@ -0,0 +1,3 @@ +#!/bin/sh +command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-commit' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; } +git lfs post-commit "$@" diff --git a/.husky/_/post-merge b/.husky/_/post-merge new file mode 100755 index 0000000..a912e66 --- /dev/null +++ b/.husky/_/post-merge @@ -0,0 +1,3 @@ +#!/bin/sh +command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-merge' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; } +git lfs post-merge "$@" diff --git a/.husky/_/pre-push b/.husky/_/pre-push new file mode 100755 index 0000000..0f0089b --- /dev/null +++ b/.husky/_/pre-push @@ -0,0 +1,3 @@ +#!/bin/sh +command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; } +git lfs pre-push "$@" diff --git a/bundle/models/isnet.json b/bundle/models/isnet.json deleted file mode 100644 index 80bd99e..0000000 --- a/bundle/models/isnet.json +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f15653496b193d078b7820ba1f5743ab063eb6e4614dc0c8e32d37bd7aa4cad7 -size 573 diff --git a/bundle/models/modnet b/bundle/models/modnet deleted file mode 100644 index 000bf52..0000000 --- a/bundle/models/modnet +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:07c308cf0fc7e6e8b2065a12ed7fc07e1de8febb7dc7839d7b7f15dd66584df9 -size 25888640 diff --git a/bundle/models/modnet_fp16 b/bundle/models/modnet_fp16 deleted file mode 100644 index 0eb487f..0000000 --- a/bundle/models/modnet_fp16 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:25f165da9bfd30830a575f1f0490f1acd995975cb349bc02f3d79332e1fe5cf6 -size 12984781 diff --git a/bundle/models/vitmatte_s b/bundle/models/vitmatte_s deleted file mode 100644 index d3d71b0..0000000 --- a/bundle/models/vitmatte_s +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:121679f49930db0d7dc852cc85d27f4793f9747abdfce5a9fee35c81126354d8 -size 118439497 diff --git a/package-lock.json b/package-lock.json index 1e807b0..6c5b092 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5766,6 +5766,9 @@ "util": "~0.12.0", "webpack": "~5.85.0", "webpack-cli": "~5.1.0" + }, + "engines": { + "node": "=20.0.0" } }, "packages/web-data": { diff --git a/packages/node-examples/src/example_001.cjs b/packages/node-examples/src/example_001.cjs index a2eaef2..e87081d 100644 --- a/packages/node-examples/src/example_001.cjs +++ b/packages/node-examples/src/example_001.cjs @@ -27,7 +27,7 @@ async function run() { ); }, // model: 'small', - model: 'isnet', + // model: 'isnet_fp16', output: { quality: 0.8, format: 'image/webp' //image/jpeg, image/webp diff --git a/packages/node/.resources.mjs b/packages/node/.resources.mjs index 5553b8c..aa2810b 100644 --- a/packages/node/.resources.mjs +++ b/packages/node/.resources.mjs @@ -1,7 +1,13 @@ export default [ { path: '/models/', - source: '../../bundle/models/*', + source: '../../bundle/models/isnet_fp16', mime: 'application/octet-steam' - } + }, + { + path: '/models/', + source: '../../bundle/models/isnet_quint8', + mime: 'application/octet-steam' + }, + ]; diff --git a/packages/node/src/schema.ts b/packages/node/src/schema.ts index 39cd89d..1d07f05 100644 --- a/packages/node/src/schema.ts +++ b/packages/node/src/schema.ts @@ -49,8 +49,6 @@ const ConfigSchema = z .preprocess( (val) => { switch (val) { - case 'large': - return 'isnet'; case 'small': return 'isnet_quint8'; case 'medium': @@ -59,7 +57,7 @@ const ConfigSchema = z return val; } }, - z.enum(['isnet', 'isnet_fp16', 'isnet_quint8']) + z.enum(['isnet_fp16', 'isnet_quint8']) ) .default('medium'), output: z diff --git a/packages/web/src/schema.ts b/packages/web/src/schema.ts index 1943ede..034aa68 100644 --- a/packages/web/src/schema.ts +++ b/packages/web/src/schema.ts @@ -13,7 +13,7 @@ const ConfigSchema = z .optional() .describe('The public path to the wasm files and the onnx model.') .default( - 'https://staticimgly.com/@imgly/background-removal-data/${PACKAGE_VERSION}/dist/' + 'https://staticimgly.com/imgly/background-removal-data/${PACKAGE_VERSION}/dist/' ) .transform((val) => { return val diff --git a/scripts/deploy-assets.mjs b/scripts/deploy-assets.mjs index 06622f7..3124275 100644 --- a/scripts/deploy-assets.mjs +++ b/scripts/deploy-assets.mjs @@ -26,9 +26,9 @@ async function syncToS3() { } const packageNames = { - 'packages/node': '@imgly/background-removal-node', - 'packages/web': '@imgly/background-removal', - 'packages/web-data': '@imgly/background-removal-data' + 'packages/node': 'imgly/background-removal-node', + 'packages/web': 'imgly/background-removal', + 'packages/web-data': 'imgly/background-removal-data' }; await Promise.allSettled(