This function adds the full path to labeling dataset. It also adds the correct path to the video file in the config file.
(config)
| 51 | |
| 52 | |
| 53 | def 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) |
no test coverage detected