| 29 | |
| 30 | |
| 31 | class RefineTracklets(DefaultTab): |
| 32 | def __init__(self, root, parent, h1_description): |
| 33 | super().__init__(root, parent, h1_description) |
| 34 | self._set_page() |
| 35 | |
| 36 | @property |
| 37 | def files(self): |
| 38 | return self.video_selection_widget.files |
| 39 | |
| 40 | def _set_page(self): |
| 41 | # TODO: Multi video select.... have to change to single video! |
| 42 | self.main_layout.addWidget(_create_label_widget("Video Selection", "font:bold")) |
| 43 | self.video_selection_widget = VideoSelectionWidget(self.root, self) |
| 44 | self.main_layout.addWidget(self.video_selection_widget) |
| 45 | |
| 46 | self.main_layout.addWidget(_create_label_widget("Attributes", "font:bold")) |
| 47 | self.layout_attributes = _create_horizontal_layout() |
| 48 | self._generate_layout_attributes(self.layout_attributes) |
| 49 | self.main_layout.addLayout(self.layout_attributes) |
| 50 | |
| 51 | self.container_layout = _create_horizontal_layout(margins=(0, 0, 0, 0)) |
| 52 | |
| 53 | self.layout_refinement_settings = _create_grid_layout(margins=(20, 0, 0, 0)) |
| 54 | self._generate_layout_refinement(self.layout_refinement_settings) |
| 55 | self.container_layout.addLayout(self.layout_refinement_settings) |
| 56 | |
| 57 | self.layout_filtering_settings = _create_grid_layout(margins=(20, 0, 0, 0)) |
| 58 | self._generate_layout_filtering(self.layout_filtering_settings) |
| 59 | self.container_layout.addLayout(self.layout_filtering_settings) |
| 60 | |
| 61 | self.main_layout.addLayout(self.container_layout) |
| 62 | |
| 63 | self.stitch_tracklets_btn = QtWidgets.QPushButton("(Re-)run stitching") |
| 64 | self.stitch_tracklets_btn.setMinimumWidth(150) |
| 65 | self.stitch_tracklets_btn.clicked.connect(self.create_tracks) |
| 66 | |
| 67 | self.edit_inferencecfg_btn = QtWidgets.QPushButton("Edit inference_cfg.yaml") |
| 68 | self.edit_inferencecfg_btn.setMinimumWidth(150) |
| 69 | self.edit_inferencecfg_btn.clicked.connect(self.open_inferencecfg_editor) |
| 70 | |
| 71 | self.filter_tracks_button = QtWidgets.QPushButton("Filter tracks ( + .csv)") |
| 72 | self.filter_tracks_button.setMinimumWidth(150) |
| 73 | self.filter_tracks_button.clicked.connect(self.filter_tracks) |
| 74 | |
| 75 | self.launch_button = QtWidgets.QPushButton("Launch track refinement GUI") |
| 76 | self.launch_button.setMinimumWidth(150) |
| 77 | self.launch_button.clicked.connect(self.refine_tracks) |
| 78 | |
| 79 | self.merge_button = QtWidgets.QPushButton("Merge dataset") |
| 80 | self.merge_button.setMinimumWidth(150) |
| 81 | self.merge_button.clicked.connect(self.merge_dataset) |
| 82 | self.merge_button.setEnabled(False) |
| 83 | |
| 84 | self.main_layout.addWidget(self.edit_inferencecfg_btn, alignment=Qt.AlignRight) |
| 85 | self.main_layout.addWidget(self.stitch_tracklets_btn, alignment=Qt.AlignRight) |
| 86 | self.main_layout.addWidget(self.launch_button, alignment=Qt.AlignRight) |
| 87 | self.main_layout.addWidget(self.filter_tracks_button, alignment=Qt.AlignRight) |
| 88 | self.main_layout.addWidget(self.merge_button, alignment=Qt.AlignRight) |