Commit f98f000a authored by Zhichao Lu's avatar Zhichao Lu Committed by pkulzc
Browse files

Update create_pascal_tf_record.py and create_pet_tf_record.py

PiperOrigin-RevId: 192494267
parent 2151c447
...@@ -104,7 +104,7 @@ def dict_to_tf_example(data, ...@@ -104,7 +104,7 @@ def dict_to_tf_example(data,
truncated = [] truncated = []
poses = [] poses = []
difficult_obj = [] difficult_obj = []
if data.has_key('object'): if 'object' in data:
for obj in data['object']: for obj in data['object']:
difficult = bool(int(obj['difficult'])) difficult = bool(int(obj['difficult']))
if ignore_difficult_instances and difficult: if ignore_difficult_instances and difficult:
......
...@@ -136,6 +136,7 @@ def dict_to_tf_example(data, ...@@ -136,6 +136,7 @@ def dict_to_tf_example(data,
poses = [] poses = []
difficult_obj = [] difficult_obj = []
masks = [] masks = []
if 'object' in data:
for obj in data['object']: for obj in data['object']:
difficult = bool(int(obj['difficult'])) difficult = bool(int(obj['difficult']))
if ignore_difficult_instances and difficult: if ignore_difficult_instances and difficult:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment