TKFace
- class tools.manual.face_viewer.viewport.TKFace(face: ndarray, size: int = 128, mask: ndarray | None = None)
Bases:
objectAn object that holds a single
tkinter.PhotoImageface, ready for placement in theViewport, Handles the placement of and removal of masks for the face as well as updates on any edits.- Parameters:
face (
numpy.ndarray) – The face, sized correctly as a 3 channel BGR image or an encoded jpg to create atkinter.PhotoImagefromsize (int, optional) – The pixel size of the face image. Default: 128
mask (
numpy.ndarrayorNone, optional) – The mask to be applied to the face image. PassNoneif no mask is to be used. DefaultNone
Attributes Summary
The face in a format that can be placed on the
FacesViewercanvas.Methods Summary
update(face, mask)Update the
photowith the given face and mask.update_mask(mask)Update the mask in the 4th channel of
phototo the given mask.Attributes Documentation
- photo
The face in a format that can be placed on the
FacesViewercanvas.- Type:
PIL.ImageTk.PhotoImage
Methods Documentation
- update(face: ndarray, mask: ndarray) None
Update the
photowith the given face and mask.- Parameters:
face (
numpy.ndarray) – The face, sized correctly as a 3 channel BGR imagemask (
numpy.ndarrayorNone) – The mask to be applied to the face image. PassNoneif no mask is to be used
- Return type:
None
- update_mask(mask: ndarray | None) None
Update the mask in the 4th channel of
phototo the given mask.- Parameters:
mask (
numpy.ndarrayorNone) – The mask to be applied to the face image. PassNoneif no mask is to be used- Return type:
None
- property photo: PhotoImage
The face in a format that can be placed on the
FacesViewercanvas.- Type:
PIL.ImageTk.PhotoImage
- update(face: ndarray, mask: ndarray) None
Update the
photowith the given face and mask.- Parameters:
face (
numpy.ndarray) – The face, sized correctly as a 3 channel BGR imagemask (
numpy.ndarrayorNone) – The mask to be applied to the face image. PassNoneif no mask is to be used
- Return type:
None