'Labmap.pbtxt file creation
I am trying to create my labelmap.pbtxt
, but the file is not created.
Here's the code
Train_Annotations_Path = "C:/Users/JAAD_dataset/Workspace/annotations/Annotations/Train"
Labels = {'-1': 'Not Crossing',
'0' : 'Not Crossing',
'1': 'Crossing'
}
print(Labels)
print(type(Labels))
# Write to labelmap.pbtxt
with open(Train_Annotations_Path + '\labelmap.pbtxt' , 'w') as f:
for label in Labels:
print(label)
f.write('item {\n')
f.write('\{}:\'{}\'\n'.format(label[-1]))
f.write('\{}:\'{}\'\n'.format(label[0]))
f.write('\{}:\'{}\'\n'.format(label[1]))
f.write('}\n')
Here's my annotation file (behaviour-specific as I am interested in crossing)
<?xml version="1.0"?>
-<ped_attributes>
<pedestrian traffic_direction="TW" signalized="n/a" old_id="pedestrian2" num_lanes="2" motion_direction="LONG" intersection="no" id="0_1_2b" group_size="1" gender="female" designated="ND" decision_point="26" crossing_point="-1" crossing="-1" age="adult"/>
<pedestrian traffic_direction="TW" signalized="n/a" old_id="pedestrian1" num_lanes="2" motion_direction="LONG" intersection="no" id="0_1_3b" group_size="1" gender="female" designated="ND" decision_point="363" crossing_point="-1" crossing="-1" age="senior"/>
</ped_attributes>
How to create labelmap.pbtxt
file for the annotation behaviour XML?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|