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