Skip to content

Instantly share code, notes, and snippets.

@tamnguyenvan
Created September 5, 2022 09:11
Show Gist options
  • Select an option

  • Save tamnguyenvan/092c478e1cc58da284199ad0b9393ca7 to your computer and use it in GitHub Desktop.

Select an option

Save tamnguyenvan/092c478e1cc58da284199ad0b9393ca7 to your computer and use it in GitHub Desktop.
categories = [
'unuse0',
'unuse1',
'1 line dark',
'2 lines dark',
'1 line light',
'2 lines light',
'unuse6',
'unuse7',
'unuse8',
'unuse9',
'unuse10',
]
filename = f'coco{len(categories)}_label_map.pbtxt'
with open(filename, 'wt') as f:
for i, cat in enumerate(categories):
f.write('item\n{' + f'\tid:{i+1}\n\tname: "{cat}"\n' + '}\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment