Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

something wrong about dataset.py crop_img() #5

Closed
YanShuang17 opened this issue May 8, 2019 · 2 comments
Closed

something wrong about dataset.py crop_img() #5

YanShuang17 opened this issue May 8, 2019 · 2 comments

Comments

@YanShuang17
Copy link

thanks for your clean code.
but i doubt that if there is something wrong in crop_img() function or not :
after while() loop, if cnt == 1000(flag==True), then there are still some vertices that are outside of the cropped img, these wrong ones should be removed from 'new_vertices' ?
another question:
suppose that after while() loop, if cnt <1000(flag==False), which means that all vertices are not cross-crop-boundry, but they don't include vertices whose label==0, because you just vertify vertices whose label==1. so if you train with ignored, the valid vertices may be not matched with the cropped img.
waiting for your comment.

@SakuraRiven
Copy link
Owner

@YanShuang17 Hi, thanks for reading these code.

  1. The function is_cross_text is used to judge if the crop has cut the text region, instead of image boundary. If the text is split, the following gt generation (distance and angle) is complicated. I was little lazy at that time to handle such cases...
    Indeed, there are some vertices out of crop range. These points don't matter because cv2.fillPoly could automatically filter out outliers.

  2. After while() loop, if cnt <1000(flag==False), it just means that the crop image doesn't cut any valid text region (label==1 vertices). And we don't have to care these ignored vertices.
    The remain vertices still have label==0 which would used in function get_score_geo.

I hope this answer helps. Umm, this repo may be not the best implementation and just for my practice. OTZ

@YanShuang17
Copy link
Author

@SakuraRiven Thanks for your explanation!
Sorry, Indeed I didn't read codes about the latter gt generation part, didn't notice cv2.fillPoly(), I just read the data augmentation part and feel something wrong...now I understand, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants