Spaces:
Running
Running
Update index.js
Browse files
index.js
CHANGED
@@ -51,7 +51,7 @@ async function detect(img) {
|
|
51 |
const { pixel_values } = await processor(image);
|
52 |
const { output0 } = await model({ images: pixel_values });
|
53 |
const predictions = output0.tolist()[0];
|
54 |
-
const threshold = 0.
|
55 |
for (const [xmin, ymin, xmax, ymax, score, id] of predictions) {
|
56 |
if (score < threshold) continue;
|
57 |
renderBox(xmin, ymin, xmax, ymax, score, model.config.id2label[id]);
|
|
|
51 |
const { pixel_values } = await processor(image);
|
52 |
const { output0 } = await model({ images: pixel_values });
|
53 |
const predictions = output0.tolist()[0];
|
54 |
+
const threshold = 0.3;
|
55 |
for (const [xmin, ymin, xmax, ymax, score, id] of predictions) {
|
56 |
if (score < threshold) continue;
|
57 |
renderBox(xmin, ymin, xmax, ymax, score, model.config.id2label[id]);
|