Update image-classification.html
Browse files
image-classification.html
CHANGED
|
@@ -106,7 +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 |
}
|
| 111 |
|
| 112 |
async function classifyImage() {
|
|
@@ -130,6 +130,7 @@
|
|
| 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 |
}
|
|
|
|
| 106 |
// Initialize the sentiment analysis model
|
| 107 |
async function initializeModel() {
|
| 108 |
classifier = await pipeline('image-classification', 'Xenova/vit-base-patch16-224');
|
| 109 |
+
console.log("Data type of classifier:", typeof classifier);
|
| 110 |
}
|
| 111 |
|
| 112 |
async function classifyImage() {
|
|
|
|
| 130 |
const url = URL.createObjectURL(file);
|
| 131 |
|
| 132 |
const result = await classifier(url);
|
| 133 |
+
console.log("Data type of result:", typeof result);
|
| 134 |
|
| 135 |
document.getElementById("outputAreaLocal").innerText = JSON.stringify(result, null, 2);
|
| 136 |
}
|