Process loaded config
(self)
| 196 | self.process_config() |
| 197 | |
| 198 | def process_config(self): |
| 199 | """Process loaded config""" |
| 200 | # Validate config |
| 201 | if isinstance(self.config_data, list): |
| 202 | videos = self.config_data |
| 203 | elif isinstance(self.config_data, dict) and "videos" in self.config_data: |
| 204 | videos = self.config_data["videos"] |
| 205 | else: |
| 206 | messagebox.showerror("Error", "Config must be a list or have 'videos' key") |
| 207 | return |
| 208 | |
| 209 | if not isinstance(videos, list) or len(videos) == 0: |
| 210 | messagebox.showerror("Error", "No videos in config") |
| 211 | return |
| 212 | |
| 213 | self.videos = videos |
| 214 | |
| 215 | # Open video captures |
| 216 | self.status_label.config(text="Opening video files...", foreground="blue") |
| 217 | self.root.update() |
| 218 | |
| 219 | self.open_videos() |
| 220 | |
| 221 | # Initialize storage - now dict per video |
| 222 | self.all_points_by_frame = [{} for _ in range(len(self.videos))] |
| 223 | |
| 224 | # Load existing points if available |
| 225 | self.load_existing_points() |
| 226 | |
| 227 | # Update UI |
| 228 | self.config_label.config(text=self.config_path.name, foreground="black") |
| 229 | self.current_video_idx = 0 |
| 230 | self.current_frame_idx = 0 |
| 231 | self.display_current_video() |
| 232 | |
| 233 | self.status_label.config( |
| 234 | text=f"Loaded {len(self.videos)} videos. Navigate frames and click points. Can add points on multiple frames!", |
| 235 | foreground="green" |
| 236 | ) |
| 237 | |
| 238 | def open_videos(self): |
| 239 | """Open all videos for frame navigation""" |
no test coverage detected