EAST icon indicating copy to clipboard operation
EAST copied to clipboard

Poly in wrong direction

Open guddulrk opened this issue 6 years ago • 8 comments

I am working on the multi-language dataset. When I train on MLT dataset provided at ICDAR, the training starts correctly, but when I change the dataset and train the dataset on my own dataset, it shows me the error as poly in the wrong direction. I have prepared dataset in the same format as ICDAR, MLT dataset. x1,y1,x2,y2,x3,y3,x4,y4 where x1, y1 are top left coordinates, x2,y2 are top right coordinates, x3, y3 are bottom right coordinates and x4,y4 are bottom left coordinates. A sample of the annotations is given below:

795,347,1241,347,1241,491,795,491,RELIA 1116,508,1230,508,1230,558,1116,558,PAI 399,633,663,633,663,680,399,680,Reliance 466,682,633,682,633,717,466,717,Paints 791,689,1253,689,1253,846,791,846,بچت

Any help, please.

guddulrk avatar May 11 '18 02:05 guddulrk

I have the same issue. I have annotated the offset values in clockwise direction, as @guddulrk mentioned. Any help please

vsd-dev avatar Jun 01 '18 12:06 vsd-dev

Same here I have the same issue.

  1. I went in to check the icdar.py and there is a function that calculates the area and flags this if area>0 ..... couldnt get the logic behind that but not sure how to solve this either.
  2. I tried to reverse the direction of poly but dint work either.
  3. @sherlocked777 the #158 issue solution that you mentioned gives only for rectangles ... for odd angle poly it cannot be in that format .... Any luck anyone?

Just as a rephrase of the problem .. what is the annotation tool did the guys, who are able to train successfully use?

rohitpattnaik avatar Sep 20 '18 03:09 rohitpattnaik

I try to turn poly question into rectangles annotations.Just like this:

x=[]
y=[]
for point in i['points']: x.append(point['x']) y.append(point['y']) ll.extend([min(x),min(y)]) ll.extend([max(x),min(y)]) ll.extend([max(x),max(y)]) ll.extend([min(x),max(y)])

zhangluustb avatar Oct 31 '18 12:10 zhangluustb

I try to turn poly question into rectangles annotations.Just like this:

x=[] y=[] for point in i['points']: x.append(point['x']) y.append(point['y']) ll.extend([min(x),min(y)]) ll.extend([max(x),min(y)]) ll.extend([max(x),max(y)]) ll.extend([min(x),max(y)])

But, this is not not solution

hegc avatar Nov 27 '18 04:11 hegc

I'm pretty sure the program, as written, will only work w/ rectangular bounding boxes.

Some helpful debug procedures:

  • In icdar.py, after line 109 add a line to print the coordinate values of the rectangle that is throwing the error, e.g.:
       if p_area > 0:
            print('poly in wrong direction')
            poly = poly[(0, 3, 2, 1), :]
            print("poly error: " + str(poly))
  • Also in icdar.py, after line 610, add a line to print which ground truth text file the module found the error, e.g.:
                text_polys, text_tags = load_annoataion(txt_fn)
                print("Working on GT txt: " + str(txt_fn))
                text_polys, text_tags = check_and_validate_polys(text_polys, text_tags, (h, w))

This should allow you to pinpoint which selection of coordinates is incorrect and in which file it shows up.

jerryrelmore avatar Mar 03 '19 12:03 jerryrelmore

icdar.py data check change if polys.shape[0] == 0: return polys

if polys.shape[0] == 0: return np.array(validated_polys), np.array(validated_tags)

Yangchao0053 avatar Nov 14 '19 03:11 Yangchao0053

poly in wrong direction poly error:[[326.3 14.98] [347.62 13.82] [347.62 27.65] [327.46 27.65]] poly in wrong direction poly error:[[302.11 12.67] [325.73 12.67] [325.73 25.92] [302.11 25.92]] poly in wrong direction poly error:[[ 65.38 2.3 ] [253.15 2.3 ] [253.15 36.29] [ 65.38 36.29]]

hello @jerryrelmore I print the poly error. I found that the text box in this dataset (ICPR MTWI 2018) is a polygon, not a rectangle. The errors are all polygons. How can I solve this?please help me,thank you!

qingqing625 avatar Dec 26 '19 09:12 qingqing625

poly in wrong direction poly error:[[326.3 14.98] [347.62 13.82] [347.62 27.65] [327.46 27.65]] poly in wrong direction poly error:[[302.11 12.67] [325.73 12.67] [325.73 25.92] [302.11 25.92]] poly in wrong direction poly error:[[ 65.38 2.3 ] [253.15 2.3 ] [253.15 36.29] [ 65.38 36.29]]

你好@jerryrelmore 我打印多边形错误。我发现此数据集(ICPR MTWI 2018)中的文本框是多边形,而不是矩形。错误是所有多边形。我该如何解决?谢谢您!

请问你的问题解决了么

gn1515591581 avatar Aug 19 '20 01:08 gn1515591581