Skip to content

Commit 2624a23

Browse files
committed
Minor fixes to match git repo.
PiperOrigin-RevId: 192166224
1 parent e25c014 commit 2624a23

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

research/object_detection/dataset_tools/create_pascal_tf_record.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,22 @@ def dict_to_tf_example(data,
104104
truncated = []
105105
poses = []
106106
difficult_obj = []
107-
for obj in data['object']:
108-
difficult = bool(int(obj['difficult']))
109-
if ignore_difficult_instances and difficult:
110-
continue
111-
112-
difficult_obj.append(int(difficult))
113-
114-
xmin.append(float(obj['bndbox']['xmin']) / width)
115-
ymin.append(float(obj['bndbox']['ymin']) / height)
116-
xmax.append(float(obj['bndbox']['xmax']) / width)
117-
ymax.append(float(obj['bndbox']['ymax']) / height)
118-
classes_text.append(obj['name'].encode('utf8'))
119-
classes.append(label_map_dict[obj['name']])
120-
truncated.append(int(obj['truncated']))
121-
poses.append(obj['pose'].encode('utf8'))
107+
if data.has_key('object'):
108+
for obj in data['object']:
109+
difficult = bool(int(obj['difficult']))
110+
if ignore_difficult_instances and difficult:
111+
continue
112+
113+
difficult_obj.append(int(difficult))
114+
115+
xmin.append(float(obj['bndbox']['xmin']) / width)
116+
ymin.append(float(obj['bndbox']['ymin']) / height)
117+
xmax.append(float(obj['bndbox']['xmax']) / width)
118+
ymax.append(float(obj['bndbox']['ymax']) / height)
119+
classes_text.append(obj['name'].encode('utf8'))
120+
classes.append(label_map_dict[obj['name']])
121+
truncated.append(int(obj['truncated']))
122+
poses.append(obj['pose'].encode('utf8'))
122123

123124
example = tf.train.Example(features=tf.train.Features(feature={
124125
'image/height': dataset_util.int64_feature(height),

research/object_detection/g3doc/evaluation_protocols.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ while for the Weighted PASCAL VOC metric the final mAP value will be influenced
3131
Similar to pascal voc 2007 detection metric, but computes the intersection over
3232
union based on the object masks instead of object boxes.
3333

34-
## Weighted PASCAL VOC detection metric
34+
## Weighted PASCAL VOC instance segmentation metric
3535

3636
`EvalConfig.metrics_set='weighted_pascal_voc_instance_segmentation_metrics'`
3737

0 commit comments

Comments
 (0)