Spaces:
Running
Running
Update index.js
Browse files
index.js
CHANGED
|
@@ -45,12 +45,12 @@ fileUpload.addEventListener('change', function (e) {
|
|
| 45 |
|
| 46 |
// Detect objects in the image
|
| 47 |
async function detect(url) {
|
| 48 |
-
// Read image
|
| 49 |
-
const image = await RawImage.fromURL(url);
|
| 50 |
-
|
| 51 |
// Update UI
|
| 52 |
imageContainer.innerHTML = '';
|
| 53 |
imageContainer.style.backgroundImage = `url(${url})`;
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
// Set container width and height depending on the image aspect ratio
|
| 56 |
const ar = image.width / image.height;
|
|
|
|
| 45 |
|
| 46 |
// Detect objects in the image
|
| 47 |
async function detect(url) {
|
|
|
|
|
|
|
|
|
|
| 48 |
// Update UI
|
| 49 |
imageContainer.innerHTML = '';
|
| 50 |
imageContainer.style.backgroundImage = `url(${url})`;
|
| 51 |
+
|
| 52 |
+
// Read image
|
| 53 |
+
const image = await RawImage.fromURL(url);
|
| 54 |
|
| 55 |
// Set container width and height depending on the image aspect ratio
|
| 56 |
const ar = image.width / image.height;
|