Explorar o código

Merge pull request #656 from xionghcx/xionghcx-patch-1

Fix ValueError when processing bbox in XML annotation file
Neal Wu %!s(int64=8) %!d(string=hai) anos
pai
achega
015490f3df
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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):