Spaces:
Running
Running
Update image-classification.html
Browse files- image-classification.html +1 -10
image-classification.html
CHANGED
|
@@ -106,11 +106,7 @@
|
|
| 106 |
// Initialize the sentiment analysis model
|
| 107 |
async function initializeModel() {
|
| 108 |
classifier = await pipeline('image-classification', 'Xenova/vit-base-patch16-224');
|
| 109 |
-
|
| 110 |
-
console.log("classifier is a Promise object");
|
| 111 |
-
} else {
|
| 112 |
-
console.log("classifier is not a Promise object");
|
| 113 |
-
}
|
| 114 |
}
|
| 115 |
|
| 116 |
async function classifyImage() {
|
|
@@ -134,11 +130,6 @@
|
|
| 134 |
const url = URL.createObjectURL(file);
|
| 135 |
|
| 136 |
const result = await classifier(url);
|
| 137 |
-
if (classifier instanceof Promise) {
|
| 138 |
-
console.log("result is a Promise object");
|
| 139 |
-
} else {
|
| 140 |
-
console.log("result is not a Promise object");
|
| 141 |
-
}
|
| 142 |
|
| 143 |
document.getElementById("outputAreaLocal").innerText = JSON.stringify(result, null, 2);
|
| 144 |
}
|
|
|
|
| 106 |
// Initialize the sentiment analysis model
|
| 107 |
async function initializeModel() {
|
| 108 |
classifier = await pipeline('image-classification', 'Xenova/vit-base-patch16-224');
|
| 109 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
}
|
| 111 |
|
| 112 |
async function classifyImage() {
|
|
|
|
| 130 |
const url = URL.createObjectURL(file);
|
| 131 |
|
| 132 |
const result = await classifier(url);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
|
| 134 |
document.getElementById("outputAreaLocal").innerText = JSON.stringify(result, null, 2);
|
| 135 |
}
|