Download static/js/drape.js from Timilehin/2D-3D: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/spaces/Timilehin/2D-3D/resolve/main/static/js/drape.js
- Command line
-
hf download hf://spaces/Timilehin/2D-3D/static/js/drape.js
-
curl -L -o drape.js https://huggingface.co/spaces/Timilehin/2D-3D/resolve/main/static/js/drape.js
1.12 kB
| document.getElementById('processModelsBtn').addEventListener('click', function() { | |
| var loadingIndicator = document.getElementById('final-loading-indicator'); | |
| loadingIndicator.style.display = 'inline-block'; | |
| var downloadLinkFinal = document.getElementById('download-link-final'); | |
| downloadLinkFinal.style.display = 'none'; | |
| downloadLinkFinal.href = ''; | |
| downloadLinkFinal.textContent = ''; | |
| fetch('/process_3d_models', { | |
| method: 'GET' | |
| }) | |
| .then(response => { | |
| if (!response.ok) { | |
| throw new Error('Failed to process the 3D models.'); | |
| } | |
| return response.blob(); | |
| }) | |
| .then(blob => { | |
| var url = window.URL.createObjectURL(blob); | |
| downloadLinkFinal.href = url; | |
| downloadLinkFinal.download = 'fitted_model.obj'; | |
| downloadLinkFinal.style.display = 'block'; | |
| downloadLinkFinal.textContent = 'Download Fitted 3D Model'; | |
| loadingIndicator.style.display = 'none'; | |
| }) | |
| .catch(error => { | |
| console.error('There was an error:', error); | |
| loadingIndicator.style.display = 'none'; | |
| }); | |
| }); | |