(p)
load annotation from the text file
    :param p:
    :return:
load annotation from the text file
    :param p:
    :return:
load annotation from the text file : param p : : return :
def load_annoataion(p):
    '''
    load annotation from the text file
    :param p:
    :return:
    '''
    text_polys = []
    text_tags = []
    if not os.path.exists(p):
        return np.array(text_polys, dtype=np.float32)
    with open(p, 'r') as f:
        reader = csv.reader(f)
        for line in reader:
            label = 'text'
            # strip BOM. \ufeff for python3,  \xef\xbb\bf for python2
            line = [i.strip('\ufeff').strip('\xef\xbb\xbf') for i in line]

            x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, line[:8]))
            text_polys.append([x1, y1, x2, y2, x3, y3, x4, y4])
            text_tags.append(label)

        return np.array(text_polys, dtype=np.int32), np.array(text_tags, dtype=np.str)
def load_annoataion ( p ) : text_polys = [ ] text_tags = [ ] if not os . path . exists ( p ) : return np . array ( text_polys , dtype = np . float32 ) with open ( p , 'r' ) as f : reader = csv . reader ( f ) for line in reader : label = 'text' # strip BOM. \ufeff for python3,  \xef\xbb\bf for python2 line = [ i . strip ( '\ufeff' ) . strip ( '\xef\xbb\xbf' ) for i in line ] x1 , y1 , x2 , y2 , x3 , y3 , x4 , y4 = list ( map ( float , line [ : 8 ] ) ) text_polys . append ( [ x1 , y1 , x2 , y2 , x3 , y3 , x4 , y4 ] ) text_tags . append ( label ) return np . array ( text_polys , dtype = np . int32 ) , np . array ( text_tags , dtype = np . str )