Unobfuscated code?

#1
by bootz15 - opened

Cool demo!!
Can you provide the original/uncompressed JS script code? I can't see what's going on...

Owner

How to deploy, is there a detailed configuration procedure?
Looking forward to your quick response

Owner

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

Owner

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:

E:\remove-background-client>

Owner

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?

Owner

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?

Owner

Can I batch it locally? Do you support it?

Yes, it should work! You just need to pass in an array of images.

@Xenova I take it then that there shouldn't be any issue porting the browser code over to nodejs, either?
(I know the point here is to show it working in the browser, which is awesome!)

Owner

@Xenova I take it then that there shouldn't be any issue porting the browser code over to nodejs, either?

Nope there shouldn't be! :) Feel free to try it out!

Sign up or log in to comment