improve the remove link area related code in craft_utils.py #111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
CRAFT-pytorch/craft_utils.py
Line 45 in e332dd8
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 !