コード例 #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 save(filename, annotations):
    name, ext = os.path.splitext(filename)

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

    if (ext == ".idl"):
        return saveIDL(filename, annotations)

    elif (ext == ".al"):
        return saveXML(filename, annotations)

    elif (ext == ".pal"):
        return PalLib.savePal(filename, PalLib.al2pal(annotations))

    else:
        assert (False)
        return False
コード例 #4
0
ファイル: AnnotationLib.py プロジェクト: brodyh/sail-car-log
def save(filename, annotations):
	name, ext = os.path.splitext(filename)

	if (ext == ".gz" or ext == ".bz2"):
		name, ext = os.path.splitext(name)
	
	if(ext == ".idl"):
		return saveIDL(filename, annotations)		

	elif(ext == ".al"):
		return saveXML(filename, annotations)

	elif(ext == ".pal"):
		return PalLib.savePal(filename, PalLib.al2pal(annotations));

	else:
		assert(False);
		return False;
コード例 #5
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
コード例 #6
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
コード例 #7
0
def save(filename, annotations):
    print "saving: ", filename;

    name, ext = os.path.splitext(filename)

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

    if(ext == ".idl"):
        return saveIDL(filename, annotations)           

    elif(ext == '.json'):
        return saveJSON(filename, annotations)

    elif(ext == ".al"):
        return saveXML(filename, annotations)

    elif(ext == ".pal"):
        return PalLib.savePal(filename, PalLib.al2pal(annotations));


    else:
        assert(False);
        return False;