Candle commited on
Commit ·
df02d45
1
Parent(s): d0b93df
stuff
Browse files- loop_labeler_ui.py +9 -0
loop_labeler_ui.py
CHANGED
|
@@ -65,11 +65,20 @@ class LoopLabeler(QWidget):
|
|
| 65 |
self.loop_checkbox = QCheckBox("Is loop?")
|
| 66 |
self.loop_checkbox.setChecked(True)
|
| 67 |
layout.addWidget(self.loop_checkbox)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
# Save button
|
| 69 |
self.save_btn = QPushButton("Save annotation")
|
| 70 |
self.save_btn.clicked.connect(self.save_annotation)
|
| 71 |
layout.addWidget(self.save_btn)
|
| 72 |
self.setLayout(layout)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
def load_json(self, json_path):
|
| 75 |
self.current_json = json_path
|
|
|
|
| 65 |
self.loop_checkbox = QCheckBox("Is loop?")
|
| 66 |
self.loop_checkbox.setChecked(True)
|
| 67 |
layout.addWidget(self.loop_checkbox)
|
| 68 |
+
# Revert button
|
| 69 |
+
self.revert_btn = QPushButton("Revert to Detected")
|
| 70 |
+
self.revert_btn.clicked.connect(self.revert_to_detected)
|
| 71 |
+
layout.addWidget(self.revert_btn)
|
| 72 |
# Save button
|
| 73 |
self.save_btn = QPushButton("Save annotation")
|
| 74 |
self.save_btn.clicked.connect(self.save_annotation)
|
| 75 |
layout.addWidget(self.save_btn)
|
| 76 |
self.setLayout(layout)
|
| 77 |
+
def revert_to_detected(self):
|
| 78 |
+
candidate = self.loop_candidates[self.current_candidate]
|
| 79 |
+
self.start_slider.setValue(candidate["start"])
|
| 80 |
+
self.end_slider.setValue(candidate["end"])
|
| 81 |
+
self.loop_checkbox.setChecked(True)
|
| 82 |
|
| 83 |
def load_json(self, json_path):
|
| 84 |
self.current_json = json_path
|