File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
element_deeplabcut/plotting Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ def plotting_results (pose_estimation_key : dict ):
2+ """
3+ Wrapper for deeplabcut.utils.plotting.PlottingResults,
4+ using dlc_result object from `dlc_reader.PoseEstimation`
5+ Args:
6+ pose_estimation_key (dict): PoseEstimation key
7+
8+ Returns:
9+ plots_dir (Path): Path to the folder containing the plots
10+ """
11+ import deeplabcut
12+ from element_deeplabcut import dlc_reader , model
13+
14+ output_dir = (model .PoseEstimationTask & pose_estimation_key ).fetch1 (
15+ "pose_estimation_output_dir"
16+ )
17+ output_dir = model .find_full_path (model .get_dlc_root_data_dir (), output_dir )
18+
19+ dlc_result = dlc_reader .PoseEstimation (output_dir )
20+
21+ plots_dir = output_dir / "plots"
22+ plots_dir .mkdir (exist_ok = True )
23+
24+ deeplabcut .utils .plotting .PlottingResults (
25+ tmpfolder = plots_dir ,
26+ Dataframe = dlc_result .rawdata ,
27+ cfg = dlc_result .yml ,
28+ bodyparts2plot = dlc_result .body_parts .to_list (),
29+ individuals2plot = "" ,
30+ showfigures = False ,
31+ suffix = ".png" ,
32+ resolution = 100 ,
33+ linewidth = 1.0 ,
34+ )
35+
36+ return plots_dir
You can’t perform that action at this time.
0 commit comments