Locate an already rendered video for a given category/id.
(self, evaluation_path: str, category: str, motion_id: int)
| 118 | return None |
| 119 | |
| 120 | def _find_source_video_path(self, evaluation_path: str, category: str, motion_id: int) -> Optional[Path]: |
| 121 | """Locate an already rendered video for a given category/id.""" |
| 122 | evaluation_path = Path(evaluation_path) |
| 123 | category_dir = self.category_dir_map.get(category) |
| 124 | if category_dir: |
| 125 | video_candidate = evaluation_path / category_dir / str(motion_id) / "motion.mp4" |
| 126 | if video_candidate.exists(): |
| 127 | return video_candidate |
| 128 | |
| 129 | for candidate in self._video_candidates(evaluation_path, motion_id): |
| 130 | if candidate.exists(): |
| 131 | return candidate |
| 132 | return None |
| 133 | |
| 134 | def _load_motion_array(self, motion_file: Path): |
| 135 | """Load motion data from a supported file into a numpy array.""" |
no test coverage detected