# Check if the image size is too small compared to the model's depth
raiseValueError("The size of the image is too small compared to the depth of the UNet. Choose a different 'resize' and/or a smaller model.")
iffinal_h==0orfinal_w==0:
msg="The size of the image is too small compared to the depth of the UNet. \
Choose a different 'resize' and/or a smaller model."
elifh_adjust!=im_heightorw_adjust!=im_width:
raiseValueError(msg)
log.warning(f"The image size doesn't match the Unet model's depth. The image is changed with '{resize}', from {im_height,im_width} to {h_adjust,w_adjust}.")
returnh_adjust,w_adjust
iffinal_h!=orig_horfinal_w!=orig_w:
log.warning(f"The image size doesn't match the Unet model's depth. \
The image is changed with '{resize}', from {orig_h,orig_w} to {final_h,final_w}.")