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
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
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()))
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()))