Spaces:
Running
Running
Update index.js
Browse files
index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
import { env, AutoProcessor, AutoModel, RawImage } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers@2.
|
2 |
|
3 |
// Since we will download the model from the Hugging Face Hub, we can skip the local model check
|
4 |
env.allowLocalModels = false;
|
@@ -65,7 +65,7 @@ async function detect(url) {
|
|
65 |
status.textContent = '';
|
66 |
|
67 |
const sizes = inputs.reshaped_input_sizes[0].reverse();
|
68 |
-
|
69 |
}
|
70 |
|
71 |
// Render a bounding box and label on the image
|
|
|
1 |
+
import { env, AutoProcessor, AutoModel, RawImage } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers@2.17.1';
|
2 |
|
3 |
// Since we will download the model from the Hugging Face Hub, we can skip the local model check
|
4 |
env.allowLocalModels = false;
|
|
|
65 |
status.textContent = '';
|
66 |
|
67 |
const sizes = inputs.reshaped_input_sizes[0].reverse();
|
68 |
+
output0.tolist()[0].forEach(x => renderBox(x, sizes));
|
69 |
}
|
70 |
|
71 |
// Render a bounding box and label on the image
|