コード例 #1
0
def __decorator(ImageName, ImageSavePath):
    ftrindex = chacracter.getImageIndex(ImageSavePath)
    if not isinstance(ftrindex, float) and not isinstance(ftrindex, int):
        raise Exception("ftrindex is not a number")
    dataImageList = featureIndex.selectFeatureIndex(ftrindex)
    if isinstance(dataImageList, int) or len(dataImageList) == 0:
        return -1
    res = calcsimmilar.calc_similiar(ImageSavePath, dataImageList)
    return res
コード例 #2
0
ファイル: decorator.py プロジェクト: cunjif/imgso
def __decorator(ImageName,ImageSavePath):
    ftrindex = chacracter.getImageIndex(ImageSavePath)
    if not isinstance(ftrindex,float) and not isinstance(ftrindex,int):
        raise Exception("ftrindex is not a number")
    dataImageList = featureIndex.selectFeatureIndex(ftrindex)
    if isinstance(dataImageList,int) or len(dataImageList) == 0:
        return -1
    res = calcsimmilar.calc_similiar(ImageSavePath,dataImageList)
    return res
コード例 #3
0
ファイル: featureIndex.py プロジェクト: cunjif/imgso
def insertFetures(ImageName,ImageSavePath):
    FeatureIndex = chacracter.getImageIndex(ImageSavePath)
    check = 0
    try:
        check = __insertImageFeatures(ImageName,FeatureIndex,ImageSavePath)
    except:
        check = 0
    if check==1:
        os.chdir(ROOTDIR)
        with open("log","a") as f:
            f.write("Save recieved image:%s file okay at %s\n" % (ImageName,time.ctime()))
    else:
        os.chdir(ROOTDIR)
        with open("log","a") as f:
            f.write("Save recieved image:%s file failed at %s\n" % (ImageName,time.ctime()))
コード例 #4
0
def insertFetures(ImageName, ImageSavePath):
    FeatureIndex = chacracter.getImageIndex(ImageSavePath)
    check = 0
    try:
        check = __insertImageFeatures(ImageName, FeatureIndex, ImageSavePath)
    except:
        check = 0
    if check == 1:
        os.chdir(ROOTDIR)
        with open("log", "a") as f:
            f.write("Save recieved image:%s file okay at %s\n" %
                    (ImageName, time.ctime()))
    else:
        os.chdir(ROOTDIR)
        with open("log", "a") as f:
            f.write("Save recieved image:%s file failed at %s\n" %
                    (ImageName, time.ctime()))