Today, every social media platform requires that the aspect ratios of uploaded videos adhere to their specified rules: for Instagram, it's 4:5, for TikTok, it's 9:16, and for YouTube, it's 16:9. Moreover, the effective aspect ratio of displayed videos can vary on different smartphones. Typically, videos are adjusted to the expected aspect ratio by adding black bars on the sides. However, this approach reduces the effective resolution of the content, and the black bars might even become larger than the video itself. An alternative approach is proposed, where the video is cropped to the desired aspect ratio while minimizing information loss. To determine the cropping window, the attention distribution of the average viewer is assessed using a neural network of the U-net architecture trained on the SALICON dataset.
to run, execute the file source.py