Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMG.LY CDN Fix #118

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .husky/_/post-checkout
Original file line number Diff line number Diff line change
@@ -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 "$@"
3 changes: 3 additions & 0 deletions .husky/_/post-commit
Original file line number Diff line number Diff line change
@@ -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 "$@"
3 changes: 3 additions & 0 deletions .husky/_/post-merge
Original file line number Diff line number Diff line change
@@ -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 "$@"
3 changes: 3 additions & 0 deletions .husky/_/pre-push
Original file line number Diff line number Diff line change
@@ -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 "$@"
3 changes: 0 additions & 3 deletions bundle/models/isnet.json

This file was deleted.

3 changes: 0 additions & 3 deletions bundle/models/modnet

This file was deleted.

3 changes: 0 additions & 3 deletions bundle/models/modnet_fp16

This file was deleted.

3 changes: 0 additions & 3 deletions bundle/models/vitmatte_s

This file was deleted.

3 changes: 3 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/node-examples/src/example_001.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions packages/node/.resources.mjs
Original file line number Diff line number Diff line change
@@ -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'
},

];
4 changes: 1 addition & 3 deletions packages/node/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ const ConfigSchema = z
.preprocess(
(val) => {
switch (val) {
case 'large':
return 'isnet';
case 'small':
return 'isnet_quint8';
case 'medium':
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions scripts/deploy-assets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading