Download static/js/human.js from Timilehin/2D-3D: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/spaces/Timilehin/2D-3D/resolve/main/static/js/human.js
- Command line
-
hf download hf://spaces/Timilehin/2D-3D/static/js/human.js
-
curl -L -o human.js https://huggingface.co/spaces/Timilehin/2D-3D/resolve/main/static/js/human.js
1.16 kB
| document.getElementById('upload-form').addEventListener('submit', function(event) { | |
| event.preventDefault(); | |
| var loadingIndicator = document.getElementById('loading-indicator'); | |
| loadingIndicator.style.display = 'inline-block'; | |
| var downloadLink = document.getElementById('download-link'); | |
| downloadLink.style.display = 'none'; | |
| var formData = new FormData(); | |
| var fileInput = document.getElementById('file-input'); | |
| formData.append('file', fileInput.files[0]); | |
| fetch('/generate-mesh', { | |
| method: 'POST', | |
| body: formData | |
| }) | |
| .then(response => response.blob()) | |
| .then(blob => { | |
| var url = window.URL.createObjectURL(blob); | |
| downloadLink.href = url; | |
| downloadLink.download = 'output.obj'; | |
| downloadLink.style.display = 'block'; | |
| downloadLink.textContent = 'Download Generated OBJ File'; | |
| loadingIndicator.style.display = 'none'; | |
| document.getElementById('next-btn').style.display = 'block'; | |
| }) | |
| .catch(error => { | |
| console.error('There was a problem with the fetch operation:', error); | |
| loadingIndicator.style.display = 'none'; | |
| }); | |
| }); | |