py-feat
py-feat copied to clipboard
Updating plots [WIP]
@ejolly I've started working on updating our plotting functions, which is long overdue.
I thought it might be nice to make them in plotly so that they are more interactive. First, I'm just building functions to recreate our existing ones in plotly. After that we can play with optimizing the layout and interactivity.
Does anyone have any thoughts on how you would like the figures to look? For example, here is my first pass at updating the Fex.plot_detections()
figures. Looks exactly the same, but I was thinking that if we mouseover a face, the tooltip might reveal the emotion or AU detector results.
@ejolly are there things on the code side that we have been wanting to refactor ?
I'm now working on remaking the AU heatmaps
ok, I have a working version with the au heatmaps. next, I'm going to work on adding some interactivity with buttons and sliders.
Added buttons to highlght different detector outputs. Plotly functionality seems a little limited, but still pretty cool.
https://github.com/cosanlab/py-feat/assets/2993338/718fc0d5-b1b1-4b5e-97d7-1007f169d22b
How can I use the fex() class?? Can you share your code??
Hi @viitormiiguel, this is still a work in progress. Feel free to checkout PR #178
Here is example for single frame:
multi_face = os.path.join(get_test_data_path(), "multi_face.jpg")
out = detector_cpu.detect_image(multi_face, batch_size=1)
out.plot_detections()
and an example for sequences of frames from a video:
video_path = os.path.join(get_test_data_path(), "WolfgangLanger_Pexels.mp4")
video_predictions = detector_cpu.detect_video(video_path, batch_size=10, skip_frames=24)
video_predictions.plot_detections()