Code generated in the video can be downloaded from here:
https://raw.githubusercontent.com/bnsreenu/python_for_microscopists/master/Tips_Tricks_42_How%20to%20remove%20text%20from%20images.py
Other code:
https://github.com/bnsreenu/python_for_microscopists
General Approach.....
Use keras OCR to detect text, define a mask around the text, and inpaint the masked regions to remove the text. To apply the mask we need to provide the coordinates of the starting and the ending points of the line, and the thickness of the line.