(self, manager, videoname, trail_len=50)
| 287 | |
| 288 | class TrackletVisualizer: |
| 289 | def __init__(self, manager, videoname, trail_len=50): |
| 290 | self.manager = manager |
| 291 | self.cmap = plt.cm.get_cmap(manager.cfg["colormap"], len(set(manager.tracklet2id))) |
| 292 | self.videoname = videoname |
| 293 | self.video = VideoReader(videoname) |
| 294 | self.nframes = len(self.video) |
| 295 | # Take into consideration imprecise OpenCV estimation of total number of frames |
| 296 | if abs(self.nframes - manager.nframes) >= 0.05 * manager.nframes: |
| 297 | print("Video duration and data length do not match. Continuing nonetheless...") |
| 298 | self.trail_len = trail_len |
| 299 | self.help_text = "" |
| 300 | self.draggable = False |
| 301 | self._curr_frame = 0 |
| 302 | self.curr_frame = 0 |
| 303 | |
| 304 | self.picked = [] |
| 305 | self.picked_pair = [] |
| 306 | self.cuts = [] |
| 307 | |
| 308 | self.mutex = QMutex() |
| 309 | self.player = BackgroundPlayer(self) |
| 310 | self.worker, self.thread_player = move_to_separate_thread(self.player.run) |
| 311 | self.thread_player.start() |
| 312 | |
| 313 | self.dps = [] |
| 314 | |
| 315 | self.swap_id1 = None |
| 316 | self.swap_id2 = None |
| 317 | |
| 318 | def _prepare_canvas(self, manager, fig): |
| 319 | params = { |
nothing calls this directly
no test coverage detected