boazchung commited on
Commit
70a55a5
1 Parent(s): ef3a3e4

Update image-classification.html

Browse files
Files changed (1) hide show
  1. image-classification.html +8 -9
image-classification.html CHANGED
@@ -105,7 +105,8 @@
105
 
106
  // Initialize the sentiment analysis model
107
  async function initializeModel() {
108
- classifier = await pipeline('image-classification', 'Xenova/vit-base-patch16-224');
 
109
 
110
  }
111
 
@@ -129,17 +130,15 @@
129
  // Create a Blob URL from the file
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
  }
136
 
137
  async function classifyTopImage() {
138
- const textFieldValue = document.getElementById("imageClassificationTopURLText").value.trim();
139
-
140
- const result = await classifier(textFieldValue, { topk: 3 });
141
-
142
- document.getElementById("outputAreaTop").innerText = JSON.stringify(result, null, 2);
143
  }
144
 
145
  // Initialize the model after the DOM is completely loaded
 
105
 
106
  // Initialize the sentiment analysis model
107
  async function initializeModel() {
108
+ // TO-Do: pipeline() 함수를 사용하여 ViT 모델 인스턴스를 classifier라는 이름으로 생성하십시오/
109
+
110
 
111
  }
112
 
 
130
  // Create a Blob URL from the file
131
  const url = URL.createObjectURL(file);
132
 
133
+ // classifier에 url을 입력하여 출력되는 결과를 result에 저장하십시오.
134
+ // 힌트: cont result = ???
135
+
136
+ // HTML코드 중 element Id가 'outputAreaLocal'인 요소에 resul의 값을 JSON string 형태로 text로 출력하십시오.
137
+ // 힌트: document.getElementById와 JSON.stringify 이용
138
  }
139
 
140
  async function classifyTopImage() {
141
+ // 코드 삭제됨
 
 
 
 
142
  }
143
 
144
  // Initialize the model after the DOM is completely loaded