Tobias Cornille commited on
Commit
56a6cec
1 Parent(s): 181d680

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +2 -2
index.js CHANGED
@@ -43,7 +43,7 @@ async function detect(img) {
43
 
44
  status.textContent = 'Analysing...';
45
 
46
- var const = new Image();
47
  image.src = img;
48
 
49
  const candidate_labels = ['human face', 'rocket', 'helmet', 'american flag'];
@@ -51,7 +51,7 @@ async function detect(img) {
51
  const output = await detector(img, candidate_labels);
52
  const relativeOutput = output.map({box, label} => ({box: {xmax: box.xmax / image.width, xmin: box.xmin / image.width, ymax: box.ymax / image.height, ymin: box.ymin / image.height}, label}))
53
  status.textContent = '';
54
- output.forEach(renderBox);
55
  };
56
 
57
  }
 
43
 
44
  status.textContent = 'Analysing...';
45
 
46
+ const image = new Image();
47
  image.src = img;
48
 
49
  const candidate_labels = ['human face', 'rocket', 'helmet', 'american flag'];
 
51
  const output = await detector(img, candidate_labels);
52
  const relativeOutput = output.map({box, label} => ({box: {xmax: box.xmax / image.width, xmin: box.xmin / image.width, ymax: box.ymax / image.height, ymin: box.ymin / image.height}, label}))
53
  status.textContent = '';
54
+ relativeOutput.forEach(renderBox);
55
  };
56
 
57
  }