Visualize transcription on inference GIF
We want to display predictions right next to the image in the generated GIF. The GIF will be twice as wide. Left half will have the current GIF animation, Right half will display the predictions.
Predictions will be shown line by line. When a box is shown in the GIF, the corresponding line is displayed on the right.
Most of the actions will happen in plot_attention. The hardest part will be to determine the right font size so that the whole line fits in the page.
Minimum height of the characters will be hardcoded to 55 (set a global variable in the module with a comment).
You can use Pillow's ImageFont module to create the predictions image. You can use and commit the Arial font to fonts/arial.ttf
and use as default value of the new --font
parameter of the teklia-dan predict
command.