CRAFT-pytorch
CRAFT-pytorch copied to clipboard
improve the remove link area related code in craft_utils.py
hi Thank you for the excellent work and share!!!
I just find that the remove link area process takes a lot of time to process: https://github.com/clovaai/CRAFT-pytorch/blob/e332dd8b718e291f51b66ff8f9ef2c98ee4474c8/craft_utils.py#L45 but, if link_threshold is too high to detect character, link_score is full of ZEROs, we do not need to remove line area process. and, if we do need to remove line area process, we can do it on the area of cv2.connectedComponentsWithStats' stats area, do not have to do it on the full picture.
So, I did some improvment on remove line area related code. 1, if link_threshold is too high and link_score is full of ZEROs, do not do remove link area process. 2, if link_score is not full of ZEROs, do remove link area process on the area of stats[k]
Thank you !