py-feat
py-feat copied to clipboard
Casting Fex DataFrame does not correctly assign default Fex metadata
When we run detections, the Detector class automatically fills out all of the relevant Fex meta data. However, when we cast at pandas dataframe as a Fex object, this needs to be manually passed as a keyword. Unfortunately, as a consequence a lot of the internal Fex functions don't work correctly such as compute_identities()
.
def __init__(self, *args, **kwargs):
### Columns ###
self.au_columns = kwargs.pop("au_columns", None)
self.emotion_columns = kwargs.pop("emotion_columns", None)
self.facebox_columns = kwargs.pop("facebox_columns", None)
self.landmark_columns = kwargs.pop("landmark_columns", None)
self.facepose_columns = kwargs.pop("facepose_columns", None)
self.identity_columns = kwargs.pop("identity_columns", None)
self.gaze_columns = kwargs.pop("gaze_columns", None)
self.time_columns = kwargs.pop("time_columns", None)
self.design_columns = kwargs.pop("design_columns", None)
### Meta data ###
self.filename = kwargs.pop("filename", None)
self.sampling_freq = kwargs.pop("sampling_freq", None)
self.detector = kwargs.pop("detector", None)
self.face_model = kwargs.pop("face_model", None)
self.landmark_model = kwargs.pop("landmark_model", None)
self.au_model = kwargs.pop("au_model", None)
self.emotion_model = kwargs.pop("emotion_model", None)
self.facepose_model = kwargs.pop("facepose_model", None)
self.identity_model = kwargs.pop("identity_model", None)
self.features = kwargs.pop("features", None)
self.sessions = kwargs.pop("sessions", None)
self.verbose = kwargs.pop("verbose", False)
@ejolly I think we should be trying to automatically figure this out if the columns are not empty or don't exist.
Grace & Luke