diff --git a/Annotation.py b/Annotation.py new file mode 100644 index 0000000..9215b51 --- /dev/null +++ b/Annotation.py @@ -0,0 +1,20 @@ +""" +Define the basic data structure of the annotation +""" +class Annotation(object): + def __init__(self): + self.name = " " + self.type = " " + self.index = 0 + self.partOfGroup = " " + self.coordinateX = [] + self.coordinateY = [] + self.xMin = 0 + self.xMax = 0 + self.yMin = 0 + self.yMax = 0 + + # Use for record which patch is in the annotation + self.patchInAnn = {} + # patch size + self.patchSize = 50 diff --git a/GetAnnFromXml.py b/GetAnnFromXml.py index ad7e5ba..38ed51a 100644 --- a/GetAnnFromXml.py +++ b/GetAnnFromXml.py @@ -1,26 +1,12 @@ """ This program is used for read an annotation xml File and store in class Annotation """ +import sys +sys.path.append("../Annotation") +from Annotation import Annotation import xml.etree.cElementTree as ET import os.path import math -class Annotation(object): - def __init__(self): - self.name = " " - self.type = " " - self.index = 0 - self.partOfGroup = " " - self.coordinateX = [] - self.coordinateY = [] - self.xMin = 0 - self.xMax = 0 - self.yMin = 0 - self.yMax = 0 - - # Use for record which patch is in the annotation - self.patchInAnn = {} - # patch size - self.patchSize = 50 class GetAnnFromXml(object): def __init__(self, fileName):