Пример #1
0
 def append_rect(self, rectangle):
     """Adding rect to the picture_info."""
     rect = Rectangle_Multiclass()
     rect.load_BBox(rectangle.x1, rectangle.x2, rectangle.y1, rectangle.y2,
                    rectangle.label, rectangle.label_chall,
                    rectangle.label_code)
     index = len(self.rects)
     self.rects.insert(index, rect)
Пример #2
0
def parse_XML_lightweight_txt(bb_XML_file_list, path_val_folder, path_dataset):

    count_rect = 0
    count_img = 0

    progress = progressbar.ProgressBar(widgets=[
        progressbar.Bar('=', '[', ']'), ' ',
        progressbar.Percentage(), ' ',
        progressbar.ETA()
    ])

    print "Start Processing & Building Dataset... may take a while..."

    path_mltcl_bb_file = path_dataset + '/' + string_mltcl_bb_file  # Create this file in .dataset/airplane/airplane_bb_mltcl_file_list.txt
    path_mltcl_class_code_file = path_dataset + '/' + string_mltcl_class_code_file
    path_mltcl_class_name_file = path_dataset + '/' + string_mltcl_class_name_file
    path_mltcl_chall_code_file = path_dataset + '/' + string_mltcl_chall_code_file

    for file_name in progress(bb_XML_file_list):
        with open(file_name, 'rt') as f:
            tree = ElementTree.parse(f)
            for obj in tree.findall('object'):
                name = obj.find('name').text
                class_code = name
                name = vid_classes.code_to_class_string(name)

                if name in ["nothing"]:
                    continue
                else:

                    same_label = 0
                    #The files with the original data path are made in both: multiclass e single class

                    path_bb_file = path_dataset + '/' + name + '/' + name + string_bb_file
                    path_class_code_file = path_dataset + '/' + name + '/' + name + string_class_code_file
                    path_class_name_file = path_dataset + '/' + name + '/' + name + string_class_name_file
                    path_chall_code_file = path_dataset + '/' + name + '/' + name + string_chall_code_file

                    path_orig_file = path_val_folder

                    jump = 0

                    image_single_class = Frame_Info()
                    image_single_class.dataset_path = path_val_folder

                    image_multi_class = Frame_Info()
                    image_multi_class.dataset_path = path_val_folder

                    rectangle_single = Rectangle_Multiclass()
                    rectangle_multi = Rectangle_Multiclass()

                    #xmin x1 letf
                    #ymin y1 bottom
                    #xmax x2 right
                    #ymax y2 top

                    for node in tree.iter():
                        tag = str(node.tag)

                        if tag in ["folder"]:
                            path_orig_file = path_orig_file + '/' + str(
                                node.text)
                            image_single_class.folder = str(node.text)
                            image_multi_class.folder = str(node.text)

                        if tag in ["filename"]:
                            image_single_class.filename = str(
                                node.text) + '.PNG'
                            image_multi_class.filename = str(
                                node.text) + '.PNG'

                            path_orig_file = path_orig_file + '/' + str(
                                node.text) + '.JPEG'

                        if tag in ['name']:
                            if str(
                                    vid_classes.code_to_class_string(
                                        str(node.text))) in ["nothing"]:
                                jump = 1
                            else:
                                jump = 0
                                rectangle_multi.label_chall = int(
                                    vid_classes.class_string_to_comp_code(
                                        str(
                                            vid_classes.code_to_class_string(
                                                str(node.text)))))
                                rectangle_multi.label_code = str(node.text)
                                rectangle_multi.label = vid_classes.code_to_class_string(
                                    str(node.text))

                                if str(node.text) == class_code:
                                    same_label = 1
                                    rectangle_single.label_chall = int(
                                        vid_classes.class_string_to_comp_code(
                                            str(
                                                vid_classes.
                                                code_to_class_string(
                                                    str(node.text)))))
                                    rectangle_single.label_code = str(
                                        node.text)
                                    rectangle_single.label = vid_classes.code_to_class_string(
                                        str(node.text))
                                else:
                                    same_label = 0

                        if tag in ["xmax"]:
                            if jump == 0:
                                rectangle_multi.x2 = float(
                                    utils_image.transform_point(
                                        image_multi_class.width,
                                        image_multi_class.height, width,
                                        height, float(node.text), False))
                                if same_label == 1:
                                    rectangle_single.x2 = float(
                                        utils_image.transform_point(
                                            image_multi_class.width,
                                            image_multi_class.height, width,
                                            height, float(node.text), False))
                        if tag in ["xmin"]:
                            if jump == 0:
                                rectangle_multi.x1 = float(
                                    utils_image.transform_point(
                                        image_multi_class.width,
                                        image_multi_class.height, width,
                                        height, float(node.text), False))
                                if same_label == 1:
                                    rectangle_single.x1 = float(
                                        utils_image.transform_point(
                                            image_multi_class.width,
                                            image_multi_class.height, width,
                                            height, float(node.text), False))
                        if tag in ["ymax"]:
                            if jump == 0:
                                rectangle_multi.y2 = float(
                                    utils_image.transform_point(
                                        image_multi_class.width,
                                        image_multi_class.height, width,
                                        height, float(node.text), False))
                                image_multi_class.append_rect(rectangle_multi)
                                count_rect = count_rect + 1
                                if same_label == 1:
                                    rectangle_single.y2 = float(
                                        utils_image.transform_point(
                                            image_multi_class.width,
                                            image_multi_class.height, width,
                                            height, float(node.text), False))
                                    image_single_class.append_rect(
                                        rectangle_single)
                        if tag in ["ymin"]:
                            if jump == 0:
                                rectangle_multi.y1 = float(
                                    utils_image.transform_point(
                                        image_multi_class.width,
                                        image_multi_class.height, width,
                                        height, float(node.text), False))
                                if same_label == 1:
                                    rectangle_single.y1 = float(
                                        utils_image.transform_point(
                                            image_multi_class.width,
                                            image_multi_class.height, width,
                                            height, float(node.text), False))

                    if jump == 0:

                        count_img = count_img + 1

                        out_stream = open(path_mltcl_bb_file, "a")
                        out_stream.write(image_multi_class.get_info_string() +
                                         os.linesep)

                        out_stream = open(path_mltcl_class_code_file, "a")
                        out_stream.write(image_multi_class.get_rects_code() +
                                         os.linesep)

                        out_stream = open(path_mltcl_class_name_file, "a")
                        out_stream.write(image_multi_class.get_rects_labels() +
                                         os.linesep)

                        out_stream = open(path_mltcl_chall_code_file, "a")
                        out_stream.write(image_multi_class.get_rects_chall() +
                                         os.linesep)

                        if same_label == 1:
                            out_stream = open(path_bb_file, "a")
                            out_stream.write(
                                image_single_class.get_info_string() +
                                os.linesep)

                            out_stream = open(path_class_code_file, "a")
                            out_stream.write(
                                image_single_class.get_rects_chall() +
                                os.linesep)

                            out_stream = open(path_class_name_file, "a")
                            out_stream.write(
                                image_single_class.get_rects_labels() +
                                os.linesep)

                            out_stream = open(path_chall_code_file, "a")
                            out_stream.write(
                                image_single_class.get_rects_code() +
                                os.linesep)
                    break
    print "SUMMARY:"
    print "Parsed: %d BB Files" % len(bb_XML_file_list)
    print "Added: %d Object Rectangles" % count_rect
    print "Added: %d Images" % count_img
    if count_img > 0:
        print "Ratio BB_Files/Images: %.2f" % (float(count_img) /
                                               float(len(bb_XML_file_list)))
    if count_rect > 0:
        print "Ratio Images/Object_Rectangles: %.2f" % (float(count_img) /
                                                        float(count_rect))
Пример #3
0
def parse_XML_to_multiclass_txt(bb_XML_file_list, path_val_folder,
                                path_dataset):

    count_rect = 0
    count_img = 0

    progress = progressbar.ProgressBar(widgets=[
        progressbar.Bar('=', '[', ']'), ' ',
        progressbar.Percentage(), ' ',
        progressbar.ETA()
    ])
    print "Start Processing & Building the MultiClass Dataset... May take a while..."

    path_mltcl_bb_file = path_dataset + '/' + string_mltcl_bb_file  # Create this file in .dataset/airplane/airplane_bb_mltcl_file_list.txt
    path_mltcl_class_code_file = path_dataset + '/' + string_mltcl_class_code_file
    path_mltcl_class_name_file = path_dataset + '/' + string_mltcl_class_name_file
    path_mltcl_chall_code_file = path_dataset + '/' + string_mltcl_chall_code_file

    for file_name in progress(bb_XML_file_list):
        with open(file_name, 'rt') as f:
            tree = ElementTree.parse(f)
            for obj in tree.findall('object'):
                name = obj.find('name').text
                class_code = name
                name = vid_classes.code_to_class_string(name)

                if name in ["nothing"]:
                    continue
                else:

                    path_orig_file = path_val_folder

                    jump = 0

                    image_multi_class = Frame_Info()
                    image_multi_class.dataset_path = path_val_folder

                    rectangle_multi = Rectangle_Multiclass()

                    #xmin x1 letf
                    #ymin y1 bottom
                    #xmax x2 right
                    #ymax y2 top

                    for node in tree.iter():
                        tag = str(node.tag)

                        if tag in ["folder"]:
                            path_orig_file = path_orig_file + '/' + str(
                                node.text)
                            image_multi_class.folder = str(node.text)

                        if tag in ["filename"]:
                            image_multi_class.filename = str(
                                node.text) + '.PNG'

                            path_orig_file = path_orig_file + '/' + str(
                                node.text) + '.JPEG'

                        if tag in ["width"]:
                            image_multi_class.width = int(node.text)

                        if tag in ["height"]:
                            image_multi_class.height = int(node.text)

                        if tag in ["trackid"]:
                            image_multi_class.frame = int(
                                os.path.basename(file_name).replace(
                                    '.xml', ''))

                        if tag in ['name']:
                            if str(
                                    vid_classes.code_to_class_string(
                                        str(node.text))) in ["nothing"]:
                                jump = 1
                            else:
                                jump = 0
                                print str(node.text)
                                rectangle_multi.label_chall = int(
                                    vid_classes.code_to_code_chall(
                                        str(node.text)))
                                rectangle_multi.label_code = str(node.text)
                                rectangle_multi.label = vid_classes.code_to_class_string(
                                    str(node.text))
                        if tag in ["xmax"]:
                            if jump == 0:
                                rectangle_multi.x2 = float(
                                    utils_image.transform_point(
                                        image_multi_class.width,
                                        image_multi_class.height, width,
                                        height, float(node.text), True))
                        if tag in ["xmin"]:
                            if jump == 0:
                                rectangle_multi.x1 = float(
                                    utils_image.transform_point(
                                        image_multi_class.width,
                                        image_multi_class.height, width,
                                        height, float(node.text), True))
                        if tag in ["ymin"]:
                            if jump == 0:
                                rectangle_multi.y2 = float(
                                    utils_image.transform_point(
                                        image_multi_class.width,
                                        image_multi_class.height, width,
                                        height, float(node.text), False))
                        if tag in ["ymax"]:
                            if jump == 0:
                                rectangle_multi.y1 = float(
                                    utils_image.transform_point(
                                        image_multi_class.width,
                                        image_multi_class.height, width,
                                        height, float(node.text), False))
                                image_multi_class.append_rect(rectangle_multi)
                                count_rect = count_rect + 1

                    if jump == 0:
                        count_img = count_img + 1
                        out_stream = open(path_mltcl_bb_file, "a")
                        out_stream.write(image_multi_class.get_info_string() +
                                         os.linesep)

                        out_stream = open(path_mltcl_class_code_file, "a")
                        out_stream.write(image_multi_class.get_rects_code() +
                                         os.linesep)

                        out_stream = open(path_mltcl_class_name_file, "a")
                        out_stream.write(image_multi_class.get_rects_labels() +
                                         os.linesep)

                        out_stream = open(path_mltcl_chall_code_file, "a")
                        out_stream.write(image_multi_class.get_rects_chall() +
                                         os.linesep)

                    break
    out_stream = open('dataset/summary_multiclass.txt', "w")
    out_stream.write("SUMMARY:" + os.linesep +
                     ("Parsed: %d BB Files" % len(bb_XML_file_list)) +
                     os.linesep +
                     ("Added: %d Object Rectangles" % count_rect) +
                     os.linesep + ("Added: %d Images" % count_img) +
                     os.linesep)
    print "Ended with Success the Process"
    print "SUMMARY:"
    print "Parsed: %d BB Files" % len(bb_XML_file_list)
    print "Added: %d Object Rectangles" % count_rect
    print "Added: %d Images" % count_img
    if count_img > 0:
        print "Ratio BB_Files/Images: %.2f" % (float(count_img) /
                                               float(len(bb_XML_file_list)))
        out_stream.write(("Ratio BB_Files/Images: %.2f" %
                          (float(count_img) / float(len(bb_XML_file_list)))) +
                         os.linesep)
    if count_rect > 0:
        print "Ratio Images/Object_Rectangles: %.2f" % (float(count_img) /
                                                        float(count_rect))
        out_stream.write(("Ratio Images/Object_Rectangles: %.2f" %
                          (float(count_img) / float(count_rect))) + os.linesep)
 def append_rect(self, rectangle):
     """Adding rect to the picture_info."""
     rect= Rectangle_Multiclass()
     rect.load_BBox( rectangle.x1, rectangle.x2, rectangle.y1, rectangle.y2, rectangle.label, rectangle.label_chall, rectangle.label_code)
     index= len(self.rects)
     self.rects.insert(index, rect)
def parse_XML_to_multiclass_txt(bb_XML_file_list, path_val_folder, path_dataset):

    count_rect=0
    count_img=0

    progress = progressbar.ProgressBar(widgets=[progressbar.Bar('=', '[', ']'), ' ',progressbar.Percentage(), ' ',progressbar.ETA()])
    print "Start Processing & Building the MultiClass Dataset... May take a while..."

    path_mltcl_bb_file=path_dataset+'/'+string_mltcl_bb_file # Create this file in .dataset/airplane/airplane_bb_mltcl_file_list.txt
    path_mltcl_class_code_file=path_dataset+'/'+string_mltcl_class_code_file
    path_mltcl_class_name_file=path_dataset+'/'+string_mltcl_class_name_file
    path_mltcl_chall_code_file=path_dataset+'/'+string_mltcl_chall_code_file

    for file_name in progress(bb_XML_file_list):
        with open(file_name, 'rt') as f:
            tree = ElementTree.parse(f)
            for obj in tree.findall('object'):
                name = obj.find('name').text
                class_code= name
                name = vid_classes.code_to_class_string(name)

                if name in ["nothing"]:
                    continue
                else:

                    path_orig_file=path_val_folder
                    
                    jump=0
                    
                    image_multi_class= Frame_Info()
                    image_multi_class.dataset_path= path_val_folder

                    rectangle_multi= Rectangle_Multiclass()
                    
                    #xmin x1 letf
                    #ymin y1 bottom
                    #xmax x2 right
                    #ymax y2 top
                
                    for node in tree.iter():
                        tag=str(node.tag)
            
                        if tag in ["folder"]:
                            path_orig_file=path_orig_file+'/'+str(node.text)
                            image_multi_class.folder= str(node.text)

                        if tag in ["filename"]:
                            image_multi_class.filename=str(node.text)+'.PNG'

                            path_orig_file=path_orig_file+'/'+str(node.text)+'.JPEG'

                        if tag in ["width"]:
                            image_multi_class.width= int(node.text)

                        if tag in ["height"]:
                            image_multi_class.height= int(node.text)

                        if tag in ["trackid"]:
                            image_multi_class.frame= int(os.path.basename(file_name).replace('.xml', ''))

                        if tag in ['name']:
                            if str(vid_classes.code_to_class_string(str(node.text))) in ["nothing"]:
                                jump = 1
                            else : 
                                jump=0
                                print str(node.text)
                                rectangle_multi.label_chall=int(vid_classes.code_to_code_chall(str(node.text)))
                                rectangle_multi.label_code=str(node.text)
                                rectangle_multi.label=vid_classes.code_to_class_string(str(node.text))      
                        if tag in ["xmax"]:
                            if jump == 0:
                                rectangle_multi.x2=float(utils_image.transform_point(image_multi_class.width,image_multi_class.height,width, height,float(node.text), True))
                        if tag in ["xmin"]:
                            if jump == 0:
                                rectangle_multi.x1=float(utils_image.transform_point(image_multi_class.width,image_multi_class.height,width, height,float(node.text), True))
                        if tag in ["ymin"]:
                            if jump == 0:
                                rectangle_multi.y2=float(utils_image.transform_point(image_multi_class.width,image_multi_class.height,width, height,float(node.text), False))      
                        if tag in ["ymax"]:
                            if jump == 0:    
                                rectangle_multi.y1=float(utils_image.transform_point(image_multi_class.width,image_multi_class.height,width, height,float(node.text), False))
                                image_multi_class.append_rect(rectangle_multi)
                                count_rect=count_rect+1

                    if jump == 0:
	                    count_img=count_img+1
	    	            out_stream = open(path_mltcl_bb_file, "a")
	    	            out_stream.write(image_multi_class.get_info_string()+ os.linesep)
	    	                
	    	            out_stream = open(path_mltcl_class_code_file, "a")
	    	            out_stream.write(image_multi_class.get_rects_code()+ os.linesep)
	    	                
	    	            out_stream = open(path_mltcl_class_name_file, "a")
	    	            out_stream.write(image_multi_class.get_rects_labels()+ os.linesep)
	    	                
	    	            out_stream = open(path_mltcl_chall_code_file, "a")
	    	            out_stream.write(image_multi_class.get_rects_chall() + os.linesep)

                    break
    out_stream = open('dataset/summary_multiclass.txt', "w")
    out_stream.write( "SUMMARY:" + os.linesep+ ("Parsed: %d BB Files"%len(bb_XML_file_list)) + os.linesep+ ("Added: %d Object Rectangles"%count_rect) + os.linesep+("Added: %d Images"%count_img)+os.linesep)
    print "Ended with Success the Process"
    print "SUMMARY:"
    print "Parsed: %d BB Files"%len(bb_XML_file_list)
    print "Added: %d Object Rectangles"%count_rect
    print "Added: %d Images"%count_img
    if count_img>0: 
        print "Ratio BB_Files/Images: %.2f"%(float(count_img)/float(len(bb_XML_file_list)))
        out_stream.write(("Ratio BB_Files/Images: %.2f"%(float(count_img)/float(len(bb_XML_file_list))))+os.linesep)
    if count_rect>0:
        print "Ratio Images/Object_Rectangles: %.2f"%(float(count_img)/float(count_rect))
        out_stream.write(("Ratio Images/Object_Rectangles: %.2f"%(float(count_img)/float(count_rect)))+os.linesep)
def parse_XML_lightweight_txt(bb_XML_file_list, path_val_folder, path_dataset):

    count_rect = 0
    count_img = 0

    progress = progressbar.ProgressBar(widgets=[progressbar.Bar('=', '[', ']'), ' ',progressbar.Percentage(), ' ',progressbar.ETA()])

    print "Start Processing & Building Dataset... may take a while..."

    path_mltcl_bb_file=path_dataset+'/'+string_mltcl_bb_file # Create this file in .dataset/airplane/airplane_bb_mltcl_file_list.txt
    path_mltcl_class_code_file=path_dataset+'/'+string_mltcl_class_code_file
    path_mltcl_class_name_file=path_dataset+'/'+string_mltcl_class_name_file
    path_mltcl_chall_code_file=path_dataset+'/'+string_mltcl_chall_code_file

    for file_name in progress(bb_XML_file_list):
        with open(file_name, 'rt') as f:
            tree = ElementTree.parse(f)
            for obj in tree.findall('object'):
                name = obj.find('name').text
                class_code= name
                name = vid_classes.code_to_class_string(name)

                if name in ["nothing"]:
                    continue
                else:
                    
                    same_label=0
                    #The files with the original data path are made in both: multiclass e single class
                    
                    
                    path_bb_file=path_dataset+'/'+name+'/'+ name+string_bb_file
                    path_class_code_file= path_dataset+'/'+name+'/'+name+string_class_code_file
                    path_class_name_file= path_dataset+'/'+name+'/'+name+string_class_name_file
                    path_chall_code_file= path_dataset+'/'+name+'/'+name+string_chall_code_file


                    path_orig_file=path_val_folder

                    
                    jump=0
                    
                    image_single_class= Frame_Info()
                    image_single_class.dataset_path= path_val_folder

                    image_multi_class= Frame_Info()
                    image_multi_class.dataset_path= path_val_folder


                    rectangle_single= Rectangle_Multiclass()
                    rectangle_multi= Rectangle_Multiclass()
                    
                    #xmin x1 letf
                    #ymin y1 bottom
                    #xmax x2 right
                    #ymax y2 top
                
                    for node in tree.iter():
                        tag=str(node.tag)
            
                        if tag in ["folder"]:
                            path_orig_file=path_orig_file+'/'+str(node.text)
                            image_single_class.folder= str(node.text)                            
                            image_multi_class.folder= str(node.text)

                        if tag in ["filename"]:
                            image_single_class.filename=str(node.text)+'.PNG'
                            image_multi_class.filename=str(node.text)+'.PNG'

                            path_orig_file=path_orig_file+'/'+str(node.text)+'.JPEG'

                        if tag in ['name']:
                            if str(vid_classes.code_to_class_string(str(node.text))) in ["nothing"]:
                                jump = 1
                            else : 
                                jump=0
                                rectangle_multi.label_chall=int(vid_classes.class_string_to_comp_code(str(vid_classes.code_to_class_string(str(node.text)))))
                                rectangle_multi.label_code=str(node.text)
                                rectangle_multi.label=vid_classes.code_to_class_string(str(node.text))

                                if str(node.text) == class_code: 
                                    same_label = 1
                                    rectangle_single.label_chall=int(vid_classes.class_string_to_comp_code(str(vid_classes.code_to_class_string(str(node.text)))))
                                    rectangle_single.label_code=str(node.text)
                                    rectangle_single.label=vid_classes.code_to_class_string(str(node.text))
                                else: same_label = 0
                                
                        if tag in ["xmax"]:
                            if jump == 0:
                                rectangle_multi.x2=float(utils_image.transform_point(image_multi_class.width,image_multi_class.height,width, height,float(node.text), False))
                                if same_label==1:
                                    rectangle_single.x2=float(utils_image.transform_point(image_multi_class.width,image_multi_class.height,width, height,float(node.text), False))
                        if tag in ["xmin"]:
                            if jump == 0:
                                rectangle_multi.x1=float(utils_image.transform_point(image_multi_class.width,image_multi_class.height,width, height,float(node.text), False))
                                if same_label==1:
                                    rectangle_single.x1=float(utils_image.transform_point(image_multi_class.width,image_multi_class.height,width, height,float(node.text), False))
                        if tag in ["ymax"]:
                            if jump == 0:
                                rectangle_multi.y2=float(utils_image.transform_point(image_multi_class.width,image_multi_class.height,width, height,float(node.text), False))                            
                                image_multi_class.append_rect(rectangle_multi) 
                                count_rect=count_rect+1
                                if same_label==1:
                                    rectangle_single.y2=float(utils_image.transform_point(image_multi_class.width,image_multi_class.height,width, height,float(node.text), False))
                                    image_single_class.append_rect(rectangle_single)
                        if tag in ["ymin"]:
                            if jump == 0:    
                                rectangle_multi.y1=float(utils_image.transform_point(image_multi_class.width,image_multi_class.height,width, height,float(node.text), False))
                                if same_label==1:
                                    rectangle_single.y1=float(utils_image.transform_point(image_multi_class.width,image_multi_class.height,width, height,float(node.text), False))

                    if jump == 0:
                        
                        count_img=count_img+1

                        out_stream = open(path_mltcl_bb_file, "a")
                        out_stream.write(image_multi_class.get_info_string()+ os.linesep)
                        
                        out_stream = open(path_mltcl_class_code_file, "a")
                        out_stream.write(image_multi_class.get_rects_code()+ os.linesep)
                        
                        out_stream = open(path_mltcl_class_name_file, "a")
                        out_stream.write(image_multi_class.get_rects_labels()+ os.linesep)
                        
                        out_stream = open(path_mltcl_chall_code_file, "a")
                        out_stream.write(image_multi_class.get_rects_chall() + os.linesep)

                        if same_label==1:
                            out_stream = open(path_bb_file, "a")
                            out_stream.write(image_single_class.get_info_string()+ os.linesep)
                            
                            out_stream = open(path_class_code_file, "a")
                            out_stream.write(image_single_class.get_rects_chall()+ os.linesep)
                            
                            out_stream = open(path_class_name_file, "a")
                            out_stream.write(image_single_class.get_rects_labels()+ os.linesep)
                            
                            out_stream = open(path_chall_code_file, "a")
                            out_stream.write(image_single_class.get_rects_code() + os.linesep)
                    break
    print "SUMMARY:"
    print "Parsed: %d BB Files"%len(bb_XML_file_list)
    print "Added: %d Object Rectangles"%count_rect
    print "Added: %d Images"%count_img
    if count_img>0: 
        print "Ratio BB_Files/Images: %.2f"%(float(count_img)/float(len(bb_XML_file_list)))
    if count_rect>0:
        print "Ratio Images/Object_Rectangles: %.2f"%(float(count_img)/float(count_rect))