Spaces:
Runtime error
Runtime error
argmax maybe will work=
Browse files
pages/3_Oxford_Vases_Disentanglement.py
CHANGED
@@ -90,7 +90,7 @@ smoothgrad_col_1, smoothgrad_col_2, smoothgrad_col_3, smoothgrad_col_4, smoothgr
|
|
90 |
|
91 |
# ---------------------------- DISPLAY COL 1 ROW 1 ------------------------------
|
92 |
with output_col_1:
|
93 |
-
separation_vector, number_important_features, imp_nodes, performance = get_separation_space(concept_ids, annotations, ann_df, latent_space=st.session_state.space_id, samples=
|
94 |
# st.write(f'Class ID {input_id} - {input_label}: {pred_prob*100:.3f}% confidence')
|
95 |
st.write('Concept vector', separation_vector)
|
96 |
header_col_1.write(f'Concept {st.session_state.concept_ids} - Space {st.session_state.space_id} - Number of relevant nodes: {number_important_features} - Val classification performance: {performance}')# - Nodes {",".join(list(imp_nodes))}')
|
@@ -143,7 +143,8 @@ else:
|
|
143 |
original_image_vec = annotations['w_vectors'][st.session_state.image_id]
|
144 |
|
145 |
img = generate_original_image(original_image_vec, model, latent_space=st.session_state.space_id)
|
146 |
-
|
|
|
147 |
# input_image = original_image_dict['image']
|
148 |
# input_label = original_image_dict['label']
|
149 |
# input_id = original_image_dict['id']
|
|
|
90 |
|
91 |
# ---------------------------- DISPLAY COL 1 ROW 1 ------------------------------
|
92 |
with output_col_1:
|
93 |
+
separation_vector, number_important_features, imp_nodes, performance = get_separation_space(concept_ids, annotations, ann_df, latent_space=st.session_state.space_id, samples=100)
|
94 |
# st.write(f'Class ID {input_id} - {input_label}: {pred_prob*100:.3f}% confidence')
|
95 |
st.write('Concept vector', separation_vector)
|
96 |
header_col_1.write(f'Concept {st.session_state.concept_ids} - Space {st.session_state.space_id} - Number of relevant nodes: {number_important_features} - Val classification performance: {performance}')# - Nodes {",".join(list(imp_nodes))}')
|
|
|
143 |
original_image_vec = annotations['w_vectors'][st.session_state.image_id]
|
144 |
|
145 |
img = generate_original_image(original_image_vec, model, latent_space=st.session_state.space_id)
|
146 |
+
print(ann_df.iloc[st.session_state.image_id, list(ann_df.column) - 'ID'])
|
147 |
+
top_pred = ann_df.iloc[st.session_state.image_id, list(ann_df.columns) - 'ID'].idxmax()
|
148 |
# input_image = original_image_dict['image']
|
149 |
# input_label = original_image_dict['label']
|
150 |
# input_id = original_image_dict['id']
|