gchhablani commited on
Commit
f907aa9
·
1 Parent(s): 0ef2c4e

Update layout

Browse files
Files changed (1) hide show
  1. app.py +12 -15
app.py CHANGED
@@ -109,9 +109,9 @@ if state.image_file is None:
109
  image = plt.imread(image_path)
110
  state.image = image
111
 
112
- col1, col2 = st.beta_columns([6, 4])
113
 
114
- if col2.button(
115
  "Get a random example",
116
  help="Get a random example from the 100 `seeded` image-text pairs.",
117
  ):
@@ -126,24 +126,21 @@ if col2.button(
126
  image = plt.imread(image_path)
127
  state.image = image
128
 
129
- col2.write("OR")
130
 
131
- uploaded_file = col2.file_uploader(
132
- "Upload your image",
133
- type=["png", "jpg", "jpeg"],
134
- help="Upload a file of your choosing.",
135
- )
136
- if uploaded_file is not None:
137
- st.error(
138
- "Uploading files does not work on HuggingFace spaces. This app only supports random examples for now."
139
- )
140
- # state.image_file = os.path.join("images/val2014", uploaded_file.name)
141
- # state.image = np.array(Image.open(uploaded_file))
142
 
143
  transformed_image = get_transformed_image(state.image)
144
 
145
  # Display Image
146
- col1.image(state.image, use_column_width="auto")
147
 
148
  new_col1, new_col2 = st.beta_columns([5, 5])
149
  # Display Question
 
109
  image = plt.imread(image_path)
110
  state.image = image
111
 
112
+ # col1, col2 = st.beta_columns([6, 4])
113
 
114
+ if st.button(
115
  "Get a random example",
116
  help="Get a random example from the 100 `seeded` image-text pairs.",
117
  ):
 
126
  image = plt.imread(image_path)
127
  state.image = image
128
 
129
+ # col2.write("OR")
130
 
131
+ # uploaded_file = col2.file_uploader(
132
+ # "Upload your image",
133
+ # type=["png", "jpg", "jpeg"],
134
+ # help="Upload a file of your choosing.",
135
+ # )
136
+ # if uploaded_file is not None:
137
+ # state.image_file = os.path.join("images/val2014", uploaded_file.name)
138
+ # state.image = np.array(Image.open(uploaded_file))
 
 
 
139
 
140
  transformed_image = get_transformed_image(state.image)
141
 
142
  # Display Image
143
+ st.image(state.image, use_column_width="auto")
144
 
145
  new_col1, new_col2 = st.beta_columns([5, 5])
146
  # Display Question