Dharini Baskaran commited on
Commit
438a23e
·
1 Parent(s): 629a389

updated app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -183,15 +183,18 @@ if uploaded_file is not None:
183
 
184
  with out_col1:
185
  if os.path.exists(output_image_path):
186
- st.image(output_image_path, caption="🖼 Output Vectorized Image", use_container_width=True)
187
-
188
  with open(output_image_path, "rb") as img_file:
189
- st.download_button(
190
- label="Download Output Image",
191
- data=img_file,
192
- file_name="floorplan_output.png",
193
- mime="image/png"
194
- )
 
 
 
 
195
 
196
  json_str = json.dumps(st.session_state.json_output, indent=4)
197
  st.download_button(
 
183
 
184
  with out_col1:
185
  if os.path.exists(output_image_path):
186
+ # st.image(output_image_path, caption="🖼 Output Vectorized Image", use_container_width=True)
 
187
  with open(output_image_path, "rb") as img_file:
188
+ image = Image.open(img_file)
189
+ st.image(image, caption="🖼 Output Vectorized Image", use_container_width=True)
190
+
191
+ img_file.seek(0) # Reset file pointer
192
+ st.download_button(
193
+ label="Download Output Image",
194
+ data=img_file,
195
+ file_name="floorplan_output.png",
196
+ mime="image/png"
197
+ )
198
 
199
  json_str = json.dumps(st.session_state.json_output, indent=4)
200
  st.download_button(