"""Reads the files containing the face locations for the frames in the videos specified by the input parameter filenames
Keyword parameters:
filenames
The filenames of the videos. This object should be a python iterable (such as a tuple or list).
Returns:
A list of numpy.ndarrays containing information about the locatied faces in the videos. Each element in the list corresponds to one input filename. Each row of the numpy.ndarray corresponds for one frame. The five columns of the numpy.ndarray denote:
* Frame number
* Bounding box top-left X coordinate
* Bounding box top-left Y coordinate
* Bounding box width
* Bounding box height
Note that not all the frames contain detected faces.
"""
facefiles=self.facefiles(filenames,directory)
facesbbx=[]
forfacefinfacefiles:
lines=open(facef,"r").readlines()
bbx=numpy.ndarray((len(lines),5),dtype='int')
lc=0
forlinlines:
words=l.split()
bbx[lc]=[int(w)forwinwords]
lc+=1
facesbbx.append(bbx)
returnfacesbbx
deffacefiles_ids(self,ids,directory=None):
"""Queries the files containing the face locations for the frames in the videos specified by the input parameter ids
"""Queries the files containing the face locations for the frames in the videos specified by the input parameter ids
"""Reads the files containing the face locations for the frames in the videos specified by the input parameter filenames
Keyword parameters:
filenames
The filenames of the videos. This object should be a python iterable (such as a tuple or list).
Returns:
A list of numpy.ndarrays containing information about the locatied faces in the videos. Each element in the list corresponds to one input filename. Each row of the numpy.ndarray corresponds for one frame. The five columns of the numpy.ndarray denote:
* Frame number
* Bounding box top-left X coordinate
* Bounding box top-left Y coordinate
* Bounding box width
* Bounding box height
Note that not all the frames contain detected faces.
"""
facefiles=self.facefiles_ids(ids,directory)
facesbbx=[]
forfacefinfacefiles:
lines=open(facef,"r").readlines()
bbx=numpy.ndarray((len(lines),5),dtype='int')
lc=0
forlinlines:
words=l.split()
bbx[lc]=[int(w)forwinwords]
lc+=1
facesbbx.append(bbx)
returnfacesbbx
defprotocols(self):
defprotocols(self):
"""Returns the names of all registered protocols"""
"""Returns the names of all registered protocols"""