Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion pigeon/annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ def show_next():
nonlocal current_index
current_index += 1
set_label_text()
update_button_style()
# If we reach the end, don't update the buttons.
if current_index < len(examples):
update_button_style()
if current_index >= len(examples):
for btn in buttons:
if btn.description == 'back':
continue
btn.disabled = True
print('Annotation done.')
return
Expand All @@ -72,6 +76,10 @@ def skip(btn):

def back(btn):
nonlocal current_index
# If the annotation was finished. Buttons needs to be re-enabled.
if current_index >= len(examples):
for btn in buttons:
btn.disabled = False
if current_index is not 0:
current_index-=2
show_next()
Expand Down