from deeplabcut.utils import visualization
cfg = auxiliaryfunctions.read_config(config)
videos = cfg["video_sets"].keys()
video_names = [_robust_path_split(video)[1] for video in videos]
folders = [
os.path.join(cfg["project_path"], "labeled-data", str(Path(i)))
for i in video_names
]
print("Creating images with labels by %s." % cfg["scorer"])
for folder in folders:
try:
DataCombined = pd.read_hdf(
os.path.join(str(folder), "CollectedData_" + cfg["scorer"] + ".h5")
)
conversioncode.guarantee_multiindex_rows(DataCombined)
if cfg.get("multianimalproject", False):
color_by = "individual" if visualizeindividuals else "bodypart"
else: # for single animal projects
color_by = "bodypart"
visualization.make_labeled_images_from_dataframe(
DataCombined,
cfg,
folder,
scale,
dpi=dpi,
keypoint=Labels[0],
draw_skeleton=draw_skeleton,
color_by=color_by,
)
except FileNotFoundError:
print("Attention:", folder, "does not appear to have labeled data!")
print(
"If all the labels are ok, then use the function 'create_training_dataset' to create the training dataset!"
)
check lable
最新推荐文章于 2024-05-28 14:00:00 发布