MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / transform_data

Function transform_data

deeplabcut/create_project/demo_data.py:53–73  ·  view source on GitHub ↗

This function adds the full path to labeling dataset. It also adds the correct path to the video file in the config file.

(config)

Source from the content-addressed store, hash-verified

51
52
53def transform_data(config):
54 """This function adds the full path to labeling dataset.
55
56 It also adds the correct path to the video file in the config file.
57 """
58
59 cfg = auxiliaryfunctions.read_config(config)
60 project_path = str(Path(config).parents[0])
61
62 cfg["project_path"] = project_path
63 if "Reaching" in project_path:
64 video_file = os.path.join(project_path, "videos", "reachingvideo1.avi")
65 elif "openfield" in project_path:
66 video_file = os.path.join(project_path, "videos", "m4s1.mp4")
67 else:
68 print("This is not an official demo dataset.")
69
70 if "WILL BE AUTOMATICALLY UPDATED BY DEMO CODE" in cfg["video_sets"].keys():
71 cfg["video_sets"][str(video_file)] = cfg["video_sets"].pop("WILL BE AUTOMATICALLY UPDATED BY DEMO CODE")
72
73 auxiliaryfunctions.write_config(config, cfg)

Callers 1

load_demo_dataFunction · 0.85

Calls 3

keysMethod · 0.80
read_configMethod · 0.45
write_configMethod · 0.45

Tested by

no test coverage detected