Body-part distance plots
Visualize the distances between pose-estimated body-parts (e.g., two animals) through line charts. Results are saved as individual line charts, and/or a video of line charts.Uses multiprocessing.
[1]:
from simba.plotting.distance_plotter_mp import DistancePlotterMultiCore
[11]:
#DEFINITIONS
CONFIG_PATH = '/Users/simon/Desktop/envs/troubleshooting/Termites_5/project_folder/project_config.ini'
STYLE_ATTRIBUTES = {'width': 640,
'height': 480,
'line width': 6,
'font size': 8,
'y_max': 'auto',
'opacity': 0.9}
LINE_ATTRIBUTES = {0: ['Termite_1_Head_1', 'Termite_4_Thorax_4', 'Dark-red'], 1: ['Termite_3_Head_3', 'Termite_4_Thorax_4', 'Orange']}
DATA_PATHS = ['/Users/simon/Desktop/envs/troubleshooting/Termites_5/project_folder/csv/outlier_corrected_movement_location/termite_test.csv']
VIDEO_SETTING = True
FRAME_SETTING = False
FINAL_IMAGE = True
CORES = 5
[12]:
plotter = DistancePlotterMultiCore(config_path=CONFIG_PATH,
frame_setting=FRAME_SETTING,
video_setting=VIDEO_SETTING,
style_attr=STYLE_ATTRIBUTES,
final_img=FINAL_IMAGE,
files_found=DATA_PATHS,
line_attr=LINE_ATTRIBUTES,
core_cnt=CORES)
plotter.create_distance_plot()
Processing 1 videos...
Creating distance plots, multiprocessing (chunksize: 1, cores: 5)...
Image 196/978, Video 1/1...
Image 392/978, Video 1/1...
Image 588/978, Video 1/1...
Image 784/978, Video 1/1...
Image 980/978, Video 1/1...
Joining termite_test multiprocessed video...
SIMBA COMPLETE: Video concatenated (elapsed time: 1.597s) complete
Distance line chart video termite_test complete (elapsed time: 32.7197s) ...
SIMBA COMPLETE: Distance plot visualizations for 1 video(s) created in project_folder/frames/output/line_plot directory (elapsed time: 32.7403s) complete
[ ]: