def readSegmentGT(gtFile):
 f = open(gtFile, 'rb')
 reader = csv.reader(f, delimiter=',')
 segStart = []
 segEnd = []
 segLabel = []
 for row in reader:
  if (len(row) == 3):
   segStart.append(float(row[0]))
   segEnd.append(float(row[1]))
   segLabel.append(row[2])
 return (numpy.array(segStart), numpy.array(segEnd), segLabel)

def readSegmentGT ( gtFile ) : f = open ( gtFile , 'rb' ) reader = csv . reader ( f , delimiter = ',' ) segStart = [ ] segEnd = [ ] segLabel = [ ] for row in reader : if ( len ( row ) == 3 ) : segStart . append ( float ( row [ 0 ] ) ) segEnd . append ( float ( row [ 1 ] ) ) segLabel . append ( row [ 2 ] ) return ( numpy . array ( segStart ) , numpy . array ( segEnd ) , segLabel )
this function reads a segmentation ground truth file .