浏览代码

fixed ValueError when processing bbox in XML annotation file

Xionghc 9 年之前
父节点
当前提交
c924285b7d
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      inception/inception/data/process_bounding_boxes.py

+ 3 - 1
inception/inception/data/process_bounding_boxes.py

@@ -102,7 +102,9 @@ def GetItem(name, root, index=0):
 
 
 def GetInt(name, root, index=0):
-  return int(GetItem(name, root, index))
+  #  In some XML annotation files, the point value are not int,  but float.
+  #  So adding a float function to avoid  ValueError.
+  return int(float(GetItem(name, root, index)))
 
 
 def FindNumberBoundingBoxes(root):