Update app.py
Browse files
app.py
CHANGED
@@ -18,12 +18,12 @@ if 'models_loaded' not in st.session_state:
|
|
18 |
# Define image processing and classification functions
|
19 |
def imageprocessing(image):
|
20 |
encoding = st.session_state.image_processor(image.convert("RGB"), return_tensors="pt")
|
|
|
21 |
return encoding
|
22 |
|
23 |
def topwear(encoding):
|
24 |
outputs = st.session_state.top_wear_model(**encoding)
|
25 |
predicted_class_idx = outputs.logits.argmax(-1).item()
|
26 |
-
st.write(st.session_state.top_wear_model.config.id2label[predicted_class_idx])
|
27 |
return st.session_state.top_wear_model.config.id2label[predicted_class_idx]
|
28 |
|
29 |
def patterns(encoding):
|
|
|
18 |
# Define image processing and classification functions
|
19 |
def imageprocessing(image):
|
20 |
encoding = st.session_state.image_processor(image.convert("RGB"), return_tensors="pt")
|
21 |
+
st.write(encoding)
|
22 |
return encoding
|
23 |
|
24 |
def topwear(encoding):
|
25 |
outputs = st.session_state.top_wear_model(**encoding)
|
26 |
predicted_class_idx = outputs.logits.argmax(-1).item()
|
|
|
27 |
return st.session_state.top_wear_model.config.id2label[predicted_class_idx]
|
28 |
|
29 |
def patterns(encoding):
|