Spaces:
Runtime error
Runtime error
<html> | |
<style> | |
html, body { | |
height: 100%; | |
margin: 0; | |
padding: 0; | |
} | |
#wrapper{ | |
background-size: contain; /* scales the image */ | |
background-position: center; /* centers the image */ | |
} | |
img{ | |
max-width: 100%; | |
max-height: 100%; | |
bottom: 0; | |
left: 0; | |
margin: auto; | |
overflow: auto; | |
position: fixed; | |
right: 0; | |
top: 0; | |
-o-object-fit: contain; | |
object-fit: contain; | |
zoom: 10; | |
} | |
</style> | |
<head> | |
<script type="module"> | |
import { client } from "https://cdn.jsdelivr.net/npm/@gradio/client/dist/index.min.js"; | |
const app = await client(window.location.origin); | |
async function getimage() { | |
try { | |
var result = await app.predict("/last_image"); | |
document.getElementById("last_image").src = "/gradio_api/file=" + result.data; | |
result = null; | |
setTimeout(getimage, 3000); | |
} catch (error) { | |
// Error... Wait a while | |
setTimeout(getimage, 20000); | |
} | |
} | |
setTimeout(getimage, 1000); | |
</script> | |
</head> | |
<body bgcolor=black> | |
<img id="last_image"> | |
</body> | |
</html> | |