Skip to content

Commit 24d8f37

Browse files
authored
Update mainwindow.py
fix a small bug
1 parent 8aa4dbe commit 24d8f37

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

widgets/mainwindow.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,19 @@ def init_segment_anything(self):
172172

173173
if not self.use_segment_anything:
174174
websites = 'https://github.com/facebookresearch/segment-anything#model-checkpoints'
175-
self.heart_beat_timer.stop()
175+
try:
176+
self.heart_beat_timer.stop()
177+
except:
178+
pass
176179
QtWidgets.QMessageBox.warning(
177180
self, 'Warning',
178181
f'The checkpoint of [Segment anything] not existed. If you want use quick annotate, '
179182
f'please download from {websites}'
180183
)
181-
self.heart_beat_timer.start(2000)
184+
try:
185+
self.heart_beat_timer.start(2000)
186+
except:
187+
pass
182188

183189
if self.use_segment_anything:
184190
if self.segany.device != 'cpu':

0 commit comments

Comments
 (0)