The original image is in shape (720, 1280) and contains a bounding box. I need to make it square without disturbing the spatial information.  Please look at the below picture.
Demonstration image. 11
I’m not sure how to add such up-down padding to this image to make it a square shape. The width is 1280 and the height is 720. So, to make it square I need to add a border of shape (1280-720) = 560 - divided by 2 - 280 px up and down. How to do this in tensorflow efficiently and dynamically?