Update index.js
Browse files
index.js
CHANGED
@@ -13,11 +13,10 @@ const EXAMPLE_URL = 'https://huggingface.co/datasets/Xenova/transformers.js-docs
|
|
13 |
|
14 |
// Create a new object detection pipeline
|
15 |
status.textContent = 'Loading model...';
|
16 |
-
const detector = await pipeline('object-detection', 'facebook/detr-resnet-50');
|
17 |
|
18 |
// To-Do #1 pipeline API를 사용하여 detr-resnet-50 object detection 모델의 instance를 detector라는 이름을 붙여 생성하십시오.
|
19 |
// DETR 모델 참고 문서 https://huggingface.co/facebook/detr-resnet-50
|
20 |
-
const detector = await '
|
21 |
status.textContent = 'Ready';
|
22 |
|
23 |
example.addEventListener('click', (e) => {
|
@@ -46,10 +45,9 @@ async function detect(img) {
|
|
46 |
imageContainer.style.backgroundImage = `url(${img})`;
|
47 |
|
48 |
status.textContent = 'Analysing...';
|
49 |
-
const output = await detector(img, { threshold: 0.5, percentage: true });
|
50 |
|
51 |
// To-Do #2 객체 탐지를 위한 오브젝트에 threshold를 0.5, percentage를 true로 지정하고 그 결과를 output에 저장하십시오
|
52 |
-
const output =
|
53 |
// threshold 값을 지정하고 쉼표를 붙이시오
|
54 |
// percentage 지정
|
55 |
);
|
|
|
13 |
|
14 |
// Create a new object detection pipeline
|
15 |
status.textContent = 'Loading model...';
|
|
|
16 |
|
17 |
// To-Do #1 pipeline API를 사용하여 detr-resnet-50 object detection 모델의 instance를 detector라는 이름을 붙여 생성하십시오.
|
18 |
// DETR 모델 참고 문서 https://huggingface.co/facebook/detr-resnet-50
|
19 |
+
const detector = await pipeline('object-detection', 'instance detector');
|
20 |
status.textContent = 'Ready';
|
21 |
|
22 |
example.addEventListener('click', (e) => {
|
|
|
45 |
imageContainer.style.backgroundImage = `url(${img})`;
|
46 |
|
47 |
status.textContent = 'Analysing...';
|
|
|
48 |
|
49 |
// To-Do #2 객체 탐지를 위한 오브젝트에 threshold를 0.5, percentage를 true로 지정하고 그 결과를 output에 저장하십시오
|
50 |
+
const output = await detector(img, { threshold: 0.5, percentage: true });
|
51 |
// threshold 값을 지정하고 쉼표를 붙이시오
|
52 |
// percentage 지정
|
53 |
);
|