Commit ·
2c4099a
1
Parent(s): 185b25b
Update app.py
Browse files
app.py
CHANGED
|
@@ -151,32 +151,32 @@ with col2:
|
|
| 151 |
|
| 152 |
_, dcol, _ = st.columns([1,5,1],gap="small")
|
| 153 |
|
| 154 |
-
|
| 155 |
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
|
| 164 |
|
| 165 |
-
|
| 166 |
|
| 167 |
-
|
| 168 |
-
|
| 169 |
|
| 170 |
-
|
| 171 |
-
|
| 172 |
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
|
| 181 |
|
| 182 |
|
|
|
|
| 151 |
|
| 152 |
_, dcol, _ = st.columns([1,5,1],gap="small")
|
| 153 |
|
| 154 |
+
|
| 155 |
|
| 156 |
+
if st.button("PROCEED",use_container_width=True) and file is not None:
|
| 157 |
+
if st.session_state.get('opt1') == True:
|
| 158 |
+
task = st.session_state.opt1_selBox
|
| 159 |
+
else:
|
| 160 |
+
task = [st.session_state.width, st.session_state.height]
|
| 161 |
+
print(task)
|
| 162 |
+
st.session_state.disable_download = not upscale(file,task)
|
| 163 |
|
| 164 |
|
| 165 |
+
#print(resulted_file.shape)
|
| 166 |
|
| 167 |
+
st.markdown("\n")
|
| 168 |
+
st.markdown("\n")
|
| 169 |
|
| 170 |
+
if file is None:
|
| 171 |
+
st.session_state.disable_download = True
|
| 172 |
|
| 173 |
+
if st.session_state.disable_download == True:
|
| 174 |
+
st.button("DOWNLOAD FILE",disabled=True,use_container_width=True)
|
| 175 |
+
else:
|
| 176 |
+
with open('processed_'+file.name, "rb") as download_file:
|
| 177 |
+
st.download_button(label="Download image", data=download_file,
|
| 178 |
+
file_name= 'processed_'+file.name, mime= "image/png",
|
| 179 |
+
use_container_width=True, disabled=st.session_state.disable_download)
|
| 180 |
|
| 181 |
|
| 182 |
|