Add difficult in writer

This commit is contained in:
ChrisDal 2017-04-25 10:24:06 +02:00 committed by GitHub
parent 0bace8fe2b
commit 04a5e8e7e4

View File

@ -45,8 +45,10 @@ class LabelFile(object):
for shape in shapes: for shape in shapes:
points = shape['points'] points = shape['points']
label = shape['label'] label = shape['label']
# Add Chris
difficult = int(shape['difficult'])
bndbox = LabelFile.convertPoints2BndBox(points) bndbox = LabelFile.convertPoints2BndBox(points)
writer.addBndBox(bndbox[0], bndbox[1], bndbox[2], bndbox[3], label) writer.addBndBox(bndbox[0], bndbox[1], bndbox[2], bndbox[3], label, difficult)
writer.save(targetFile=filename) writer.save(targetFile=filename)
return return