ludusc commited on
Commit
def48ab
1 Parent(s): 9db1d14

more choices to dis

Browse files
data/vase_annotated_files/sim_Fabric_seeds0000-20000.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20fa48320e20998aad5665610083843705608a5f06ff081e4395ee4b5ac9cba3
3
+ size 9731011
data/vase_annotated_files/sim_Provenance_seeds0000-20000.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a421ffd119eee312249c9fbd05ac65460849e71f538d05fad223cb55423f315f
3
+ size 18066428
data/vase_annotated_files/sim_Technique_seeds0000-20000.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3d3425e15d76d47a8829783cadbd7072698083df199617a8423d5ccb9d88714
3
+ size 2484876
pages/3_Oxford_Vases_Disentanglement.py CHANGED
@@ -31,8 +31,6 @@ annotations_file = './data/vase_annotated_files/seeds0000-20000.pkl'
31
  with open(annotations_file, 'rb') as f:
32
  annotations = pickle.load(f)
33
 
34
- ann_df = pd.read_csv('./data/vase_annotated_files/sim_Shape Name_seeds0000-20000.csv')
35
- labels = ann_df.columns
36
 
37
  if 'image_id' not in st.session_state:
38
  st.session_state.image_id = 0
@@ -53,7 +51,12 @@ with input_col_1:
53
 
54
  # image_id = st.number_input('Image ID: ', format='%d', step=1)
55
  st.write('**Choose two options to disentangle**')
56
- concept_ids = st.multiselect('Concepts:', tuple(labels), max_selections=2, default=['AMPHORA', 'CHALICE'])
 
 
 
 
 
57
 
58
  st.write('**Choose a latent space to disentangle**')
59
  space_id = st.selectbox('Space:', tuple(['W', 'Z']))
@@ -142,12 +145,8 @@ if st.session_state.space_id == 'Z':
142
  else:
143
  original_image_vec = annotations['w_vectors'][st.session_state.image_id]
144
 
145
- print(ann_df.head())
146
  img = generate_original_image(original_image_vec, model, latent_space=st.session_state.space_id)
147
  cols = list(ann_df.columns)
148
- cols.remove('Unnamed: 0')
149
- cols.remove('ID')
150
- print(ann_df.loc[st.session_state.image_id, cols])
151
  top_pred = ann_df.loc[st.session_state.image_id, cols].astype(float).idxmax()
152
  # input_image = original_image_dict['image']
153
  # input_label = original_image_dict['label']
 
31
  with open(annotations_file, 'rb') as f:
32
  annotations = pickle.load(f)
33
 
 
 
34
 
35
  if 'image_id' not in st.session_state:
36
  st.session_state.image_id = 0
 
51
 
52
  # image_id = st.number_input('Image ID: ', format='%d', step=1)
53
  st.write('**Choose two options to disentangle**')
54
+ type_col = st.selectbox('Concept category:', tuple(['Provenance', 'Shape Name', 'Fabric', 'Technique']))
55
+
56
+ ann_df = pd.read_csv(f'./data/vase_annotated_files/sim_{type_col}_seeds0000-20000.csv')
57
+ labels = ann_df.columns
58
+
59
+ concept_ids = st.multiselect('Concepts:', tuple(labels), max_selections=2, default=[labels[0], labels[1]])
60
 
61
  st.write('**Choose a latent space to disentangle**')
62
  space_id = st.selectbox('Space:', tuple(['W', 'Z']))
 
145
  else:
146
  original_image_vec = annotations['w_vectors'][st.session_state.image_id]
147
 
 
148
  img = generate_original_image(original_image_vec, model, latent_space=st.session_state.space_id)
149
  cols = list(ann_df.columns)
 
 
 
150
  top_pred = ann_df.loc[st.session_state.image_id, cols].astype(float).idxmax()
151
  # input_image = original_image_dict['image']
152
  # input_label = original_image_dict['label']