Xenova HF staff commited on
Commit
6ed5b70
1 Parent(s): 1ef8d50

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +1 -1
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.5;
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]);