Spaces:
Running
Running
Tobias Cornille
commited on
Commit
·
4424728
1
Parent(s):
5b80cc9
Update index.js
Browse files
index.js
CHANGED
@@ -49,7 +49,7 @@ async function detect(img) {
|
|
49 |
const candidate_labels = ['human face', 'rocket', 'helmet', 'american flag'];
|
50 |
image.onload = async function () {
|
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 |
};
|
|
|
49 |
const candidate_labels = ['human face', 'rocket', 'helmet', 'american flag'];
|
50 |
image.onload = async function () {
|
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 |
};
|