Spaces:
Runtime error
Runtime error
fixed minor issues
Browse files
app.py
CHANGED
@@ -130,7 +130,6 @@ def process_multiple_images(uploaded_files, img_size=800):
|
|
130 |
img_names_list = []
|
131 |
idx = 1
|
132 |
for idx, uploaded_file in enumerate(uploaded_files, start=1):
|
133 |
-
|
134 |
st_title_message.markdown("**Processing image {}/{}. Please wait** β".format(idx,
|
135 |
num_imgs))
|
136 |
|
@@ -144,8 +143,7 @@ def process_multiple_images(uploaded_files, img_size=800):
|
|
144 |
resized_pil_img = PIL.Image.fromarray(resized_img_rgb)
|
145 |
|
146 |
# Send the image to the model
|
147 |
-
|
148 |
-
output_pil_img = resized_pil_img
|
149 |
|
150 |
output_images_list.append(output_pil_img)
|
151 |
img_names_list.append(img_name.split('.')[0])
|
@@ -218,15 +216,14 @@ st_color_option = st.sidebar.selectbox('Select colorizer mode',
|
|
218 |
# det_nms_thres = st.sidebar.slider("Non-maximum supression IoU", 0.1, 0.9, value=0.4, step=0.1)
|
219 |
|
220 |
# Load models
|
221 |
-
print('before loading the model')
|
222 |
try:
|
|
|
223 |
colorizer = load_model(model_folder, st_color_option)
|
224 |
-
|
225 |
-
pass
|
226 |
-
colorizer = True
|
227 |
-
# print('Error while loading the model. Please refresh the page')
|
228 |
-
print('after loading the model')
|
229 |
|
|
|
|
|
|
|
230 |
|
231 |
if colorizer is not None:
|
232 |
st_title_message.markdown("**To begin, please upload an image** π")
|
|
|
130 |
img_names_list = []
|
131 |
idx = 1
|
132 |
for idx, uploaded_file in enumerate(uploaded_files, start=1):
|
|
|
133 |
st_title_message.markdown("**Processing image {}/{}. Please wait** β".format(idx,
|
134 |
num_imgs))
|
135 |
|
|
|
143 |
resized_pil_img = PIL.Image.fromarray(resized_img_rgb)
|
144 |
|
145 |
# Send the image to the model
|
146 |
+
output_pil_img = colorizer.plot_transformed_pil_image(resized_pil_img, render_factor=35, compare=False)
|
|
|
147 |
|
148 |
output_images_list.append(output_pil_img)
|
149 |
img_names_list.append(img_name.split('.')[0])
|
|
|
216 |
# det_nms_thres = st.sidebar.slider("Non-maximum supression IoU", 0.1, 0.9, value=0.4, step=0.1)
|
217 |
|
218 |
# Load models
|
|
|
219 |
try:
|
220 |
+
print('before loading the model')
|
221 |
colorizer = load_model(model_folder, st_color_option)
|
222 |
+
print('after loading the model')
|
|
|
|
|
|
|
|
|
223 |
|
224 |
+
except:
|
225 |
+
colorizer = None
|
226 |
+
print('Error while loading the model. Please refresh the page')
|
227 |
|
228 |
if colorizer is not None:
|
229 |
st_title_message.markdown("**To begin, please upload an image** π")
|