Spaces:
Running
Running
Update mobilevit.html
Browse files- mobilevit.html +5 -5
mobilevit.html
CHANGED
|
@@ -7,8 +7,9 @@
|
|
| 7 |
|
| 8 |
<script type="module">
|
| 9 |
// 허깅페이스의 pipeline 모듈을 import하십시오.
|
| 10 |
-
|
| 11 |
-
|
|
|
|
| 12 |
|
| 13 |
// Make it available globally
|
| 14 |
window.pipeline = pipeline;
|
|
@@ -117,7 +118,7 @@
|
|
| 117 |
|
| 118 |
// pipeline 함수를 이용하여 Xenova/mobilevit-small 모델의 인스턴스를 생성하여 이를 classifier에 저정하십시오. 인스턴스 생성 시 quantized 파라미터의 값을 false로 설정하십시오.
|
| 119 |
// To-Do: ???
|
| 120 |
-
classifier = await pipeline ('image-classification', 'Xenova/mobilevit-small');
|
| 121 |
}
|
| 122 |
|
| 123 |
|
|
@@ -130,7 +131,7 @@
|
|
| 130 |
// HTML DOM의 element Id가 imageClassificationLocalFile인 element의 값을 fileInput으로 저장하십시오.
|
| 131 |
// To-Do: const fileInput = ???
|
| 132 |
const fileInput = document.getElementById("imageClassificationLocalFile").value.trim();
|
| 133 |
-
const result = await classifier(fileInput); //va bene questa seconda
|
| 134 |
|
| 135 |
const file = fileInput.files[0];
|
| 136 |
if (!file) {
|
|
@@ -151,7 +152,6 @@
|
|
| 151 |
// To-Do: ???
|
| 152 |
const result = await classifier(textFieldValue, {
|
| 153 |
top_k: 3,
|
| 154 |
-
|
| 155 |
});
|
| 156 |
|
| 157 |
|
|
|
|
| 7 |
|
| 8 |
<script type="module">
|
| 9 |
// 허깅페이스의 pipeline 모듈을 import하십시오.
|
| 10 |
+
// To-Do: ???
|
| 11 |
+
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@xenova/[email protected]';
|
| 12 |
+
|
| 13 |
|
| 14 |
// Make it available globally
|
| 15 |
window.pipeline = pipeline;
|
|
|
|
| 118 |
|
| 119 |
// pipeline 함수를 이용하여 Xenova/mobilevit-small 모델의 인스턴스를 생성하여 이를 classifier에 저정하십시오. 인스턴스 생성 시 quantized 파라미터의 값을 false로 설정하십시오.
|
| 120 |
// To-Do: ???
|
| 121 |
+
classifier = await pipeline ('image-classification', 'Xenova/mobilevit-small', {quantized:false});
|
| 122 |
}
|
| 123 |
|
| 124 |
|
|
|
|
| 131 |
// HTML DOM의 element Id가 imageClassificationLocalFile인 element의 값을 fileInput으로 저장하십시오.
|
| 132 |
// To-Do: const fileInput = ???
|
| 133 |
const fileInput = document.getElementById("imageClassificationLocalFile").value.trim();
|
| 134 |
+
const result = await classifier(fileInput); //va bene questa seconda?????
|
| 135 |
|
| 136 |
const file = fileInput.files[0];
|
| 137 |
if (!file) {
|
|
|
|
| 152 |
// To-Do: ???
|
| 153 |
const result = await classifier(textFieldValue, {
|
| 154 |
top_k: 3,
|
|
|
|
| 155 |
});
|
| 156 |
|
| 157 |
|