Created
December 1, 2020 05:49
-
-
Save zakirangwala/cbbd9253493b40763b8e7e5fbbe4c11d to your computer and use it in GitHub Desktop.
Create Label Map - Mask Detector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Label Map | |
def construct_label_map(): | |
labels = [{'name': 'Mask', 'id': 1}, {'name': 'NoMask', 'id': 2}] | |
with open(ANNOTATION_PATH + '\label_map.pbtxt', 'w') as f: | |
for label in labels: | |
f.write('item { \n') | |
f.write('\tname:\'{}\'\n'.format(label['name'])) | |
f.write('\tid:{}\n'.format(label['id'])) | |
f.write('}\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment