Spaces:
Running
Unobfuscated code?
Cool demo!!
Can you provide the original/uncompressed JS script code? I can't see what's going on...
It's located in the transformers.js GitHub repo: https://github.com/xenova/transformers.js/tree/main/examples/remove-background-client
How to deploy, is there a detailed configuration procedure?
Looking forward to your quick response
npm run build
:) Then upload the generated files (located in dist
) to your favorite static hosting site.
Thank you for your quick response, but,Command prompt
npm run build
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\xjc\package.json
npm ERR! errno -4058
npm ERR! enoent Could not read package.json: Error: ENOENT: no such file or directory, open 'C:\Users\xjc\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in: C:\Users\xjc\AppData\Local\npm-cache_logs\2024-04-01T02_08_31_624Z-debug-0.log
Make sure you run this from the correct directory: https://github.com/xenova/transformers.js/tree/main/examples/remove-background-client
thank you !
E:>cd remove-background-client
E:\remove-background-client>npm run build
[email protected] build
vite build
vite v5.0.12 building for production...
node_modules/onnxruntime-web/dist/ort-web.min.js (6:62546) Use of eval in "node_modules/onnxruntime-web/dist/ort-web.min.js" is strongly discouraged as it poses security risks and may cause issues with minification.
✓ 36 modules transformed.
dist/index.html 1.49 kB │ gzip: 0.85 kB
dist/assets/index-SojaDS6z.css 0.79 kB │ gzip: 0.45 kB
dist/assets/index-E_M5nW8h.js 701.29 kB │ gzip: 169.73 kB
(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 1.21s
E:\remove-background-client>
Looks right! You can now upload the contents in dist
to, for example, a new HF space: https://huggingface.co/new-space?sdk=static
How to deploy locally?
You can just run npm run dev
... then go to the link that is printed out
Thank you. Great!!!
VITE v5.0.12 ready in 163 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h + enter to show help
Can I batch it locally? Do you support it?
Can I batch it locally? Do you support it?
Yes, it should work! You just need to pass in an array of images.