From 04a5e8e7e49f26803c921f29e5ed7a4ca01ab8e8 Mon Sep 17 00:00:00 2001 From: ChrisDal Date: Tue, 25 Apr 2017 10:24:06 +0200 Subject: [PATCH] Add difficult in writer --- libs/labelFile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/labelFile.py b/libs/labelFile.py index 6b12e460..590e52f9 100644 --- a/libs/labelFile.py +++ b/libs/labelFile.py @@ -45,8 +45,10 @@ class LabelFile(object): for shape in shapes: points = shape['points'] label = shape['label'] + # Add Chris + difficult = int(shape['difficult']) 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) return