def read_points_from_xml(xmlFileName):
 xmldoc = minidom.parse(xmlFileName)
 facelist = xmldoc.getElementsByTagName('face')
 faces = {}
 for xmlFace in facelist:
  fileName = xmlFace.attributes['file'].value
  xf = int(xmlFace.attributes['xf'].value)
  yf = int(xmlFace.attributes['yf'].value)
  xs = int(xmlFace.attributes['xs'].value)
  ys = int(xmlFace.attributes['ys'].value)
  xm = int(xmlFace.attributes['xm'].value)
  ym = int(xmlFace.attributes['ym'].value)
  faces[fileName] = array([xf, yf, xs, ys, xm, ym])
 return faces

def read_points_from_xml ( xmlFileName ) : xmldoc = minidom . parse ( xmlFileName ) facelist = xmldoc . getElementsByTagName ( 'face' ) faces = { } for xmlFace in facelist : fileName = xmlFace . attributes [ 'file' ] . value xf = int ( xmlFace . attributes [ 'xf' ] . value ) yf = int ( xmlFace . attributes [ 'yf' ] . value ) xs = int ( xmlFace . attributes [ 'xs' ] . value ) ys = int ( xmlFace . attributes [ 'ys' ] . value ) xm = int ( xmlFace . attributes [ 'xm' ] . value ) ym = int ( xmlFace . attributes [ 'ym' ] . value ) faces [ fileName ] = array ( [ xf , yf , xs , ys , xm , ym ] ) return faces
reads control points for face alignment .