-
Notifications
You must be signed in to change notification settings - Fork 747
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
Error report: Textsnake for generating ground truth targets. #100
Comments
Sorry for disturbing, I found the reason of the bug, it came from a invalid annotation. I fix the issue by double-check the labels. Here is the script to figure out the invalid points. from shapely.geometry import Polygon, LinearRing
import glob
import random
anno_root = 'annotations/training/'
filelist = glob.glob(anno_root+"*.txt")
assert len(filelist) > 0
def check_polygon(filename):
t = open(filename)
for line in t.readlines():
cors = line.strip().split(',')
assert (len(cors) % 2) == 0, "invalid cors"
pts = [(int(cors[j]), int(cors[j+1])) for j in range(0, len(cors)-1, 2)]
try:
pgt = Polygon(pts)
except Exception as e:
print('Not a valid polygon', pgt)
continue
if not pgt.is_valid:
print('GT polygon has intersecting sides', pts)
continue
pRing = LinearRing(pts)
if not pRing.is_ccw:
pts.reverse()
t.close()
# test
check_polygon(random.choice(filelist))
for i in filelist:
check_polygon(i) |
@Bovey0809 Hi. I have the same problem. This error shows what is wrong with the data? I have filtered the data with your check code, but I still have this problem.
|
@FFoCC Thanks for your feedback. Could you provide the polyline data that the code wrongly processed? |
@HolyCrap96 I don't know which piece of data is wrong. It is strange that sometimes my dataset can work with three epochs and a fourth error. |
@HolyCrap96 Here are two examples of my data. Is there anything wrong with them?
|
Probably get fixed in #448, which is a part of MMOCR 0.3.0. |
When training the textsnake for my own data, issue randomly came out from
mmocr/mmocr/datasets/pipelines/textdet_targets/textsnake_targets.py
Line 205 in 6c1c34f
Same issue here, princewang1994/TextSnake.pytorch#30
I'm trying to figure out, thanks a lot if you can help with that.
The text was updated successfully, but these errors were encountered: