コード例 #1
0
def parse(filename):
    name, ext = os.path.splitext(filename)

    if (ext == ".gz" or ext == ".bz2"):
        name, ext = os.path.splitext(name)

    if (ext == ".idl"):
        return parseIDL(filename)

    if (ext == ".al"):
        return parseXML(filename)

    if (ext == ".pal"):
        return PalLib.pal2al(PalLib.loadPal(filename))

    return []
コード例 #2
0
ファイル: AnnotationLib.py プロジェクト: brodyh/sail-car-log
def parse(filename):
	name, ext = os.path.splitext(filename)
	
	if (ext == ".gz" or ext == ".bz2"):
		name, ext = os.path.splitext(name)
	
	if(ext == ".idl"):
		return parseIDL(filename)
		
	if(ext == ".al"):
		return parseXML(filename)
	
	if(ext == ".pal"):
		return PalLib.pal2al(PalLib.loadPal(filename));

	return []
コード例 #3
0
def parse(filename, abs_path=False):
    #print "Parsing: ", filename
    name, ext = os.path.splitext(filename)

    if (ext == ".gz" or ext == ".bz2"):
        name, ext = os.path.splitext(name)

    if (ext == ".idl"):
        annolist = parseIDL(filename)
    elif (ext == ".al"):
        annolist = parseXML(filename)
    elif (ext == ".pal"):
        annolist = PalLib.pal2al(PalLib.loadPal(filename))
    else:
        annolist = AnnoList([])

    if abs_path:
        basedir = os.path.dirname(os.path.abspath(filename))
        for a in annolist:
            a.imageName = basedir + "/" + os.path.basename(a.imageName)

    return annolist
コード例 #4
0
ファイル: AnnotationLib.py プロジェクト: BlakePan/TensorBox
def parse(filename, abs_path=False):
	#print "Parsing: ", filename
	name, ext = os.path.splitext(filename)
	
	if (ext == ".gz" or ext == ".bz2"):
		name, ext = os.path.splitext(name)
	
	if(ext == ".idl"):
		annolist = parseIDL(filename)
        elif(ext == ".al"):
		annolist = parseXML(filename)
        elif(ext == ".pal"):
		annolist = PalLib.pal2al(PalLib.loadPal(filename));
        else:
                annolist = AnnoList([]);

        if abs_path:
                basedir = os.path.dirname(os.path.abspath(filename))
                for a in annolist:
                        a.imageName = basedir + "/" + os.path.basename(a.imageName)

	return annolist