Spaces:
Runtime error
Runtime error
Download index.html from Piarasingh85/test: direct link, hf CLI and curl.
- Browser
- Download file 959 Bytes
-
https://huggingface.co/spaces/Piarasingh85/test/resolve/main/index.html
- Command line
-
hf download hf://spaces/Piarasingh85/test/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Piarasingh85/test/resolve/main/index.html
959 Bytes
| <html> | |
| <head> | |
| <title>Live Feed with Hugging Face</title> | |
| </head> | |
| <body> | |
| <video id="video" width="640" height="480" autoplay></video> | |
| <script> | |
| const video = document.getElementById('video'); | |
| const ws = new WebSocket("ws://localhost:8000/ws"); | |
| ws.onmessage = function(event) { | |
| const predictions = JSON.parse(event.data); | |
| console.log(predictions); | |
| // Process predictions to draw bounding boxes, etc. | |
| }; | |
| // This part is to display the live video feed | |
| if (navigator.mediaDevices.getUserMedia) { | |
| navigator.mediaDevices.getUserMedia({ video: true }) | |
| .then(function(stream) { | |
| video.srcObject = stream; | |
| }) | |
| .catch(function(error) { | |
| console.log("Something went wrong!"); | |
| }); | |
| } | |
| </script> | |
| </body> | |
| </html> | |