예제 #1
0
    def __init__(self, nnimage_file, imgClick_file, qrysim='O', n_top_img = 50, n_top_query = 30):

        # load nn info with distances of images
        self.img2nnimgdis = readNnData(nnimage_file, n_top_img)  # format: img_id img_id dis ...
        print ("[%s] %d images and these top %d nearest neighbours with distance loaded from %s" % 
            (self.__class__.__name__, len(self.img2nnimgdis) , n_top_img, nnimage_file))

        # load query info with click of images  
        self.img2query_clc = readImageClickture(imgClick_file, n_top_query)  # format: img_id /t query /t click ...
        print ("[%s] %d images and these %d queris with click loaded from %s" % 
            (self.__class__.__name__, len(self.img2query_clc) , n_top_query, imgClick_file))

        self.qrySimer = getQuerySimer(qrysim)
예제 #2
0
파일: text2image.py 프로젝트: danieljf/cmrf
    def __init__(self, nnquery_file, qryClick_file, dev_feat_path, train_feat_path, top_n=50):

        # load nn info with score of query
        self.qid2nnqidscore = readNnData(nnquery_file, top_n) # format: query_id query_id score ...
        print ("[%s] %d queris and these top %d nearest neighbours with score loaded from %s" %
        	(self.__class__.__name__, len(self.qid2nnqidscore) , top_n, nnquery_file))


        self.qry2img_clk = readQueryClickture(qryClick_file)   # format: query_id  \t image_id click ...  
        print ("[%s] %d queris and these click info loaded from %s" % 
        	(self.__class__.__name__, len(self.qry2img_clk) ,  qryClick_file))


        self.imgSimer = ImageSimer( dev_feat_path, train_feat_path )
예제 #3
0
    def __init__(self, nnquery_file, qryClick_file, dev_feat_path, train_feat_path, top_n=50):

        # load nn info with score of query
        self.qid2nnqidscore = readNnData(nnquery_file, top_n) # format: query_id query_id score ...
        print ("[%s] %d queris and these top %d nearest neighbours with score loaded from %s" %
        	(self.__class__.__name__, len(self.qid2nnqidscore) , top_n, nnquery_file))


        self.qry2img_clk = readQueryClickture(qryClick_file)   # format: query_id  \t image_id click ...  
        print ("[%s] %d queris and these click info loaded from %s" % 
        	(self.__class__.__name__, len(self.qry2img_clk) ,  qryClick_file))


        self.imgSimer = ImageSimer( dev_feat_path, train_feat_path )
예제 #4
0
    def __init__(self,
                 nnimage_file,
                 imgClick_file,
                 qrysim='O',
                 n_top_img=50,
                 n_top_query=30):

        # load nn info with distances of images
        self.img2nnimgdis = readNnData(
            nnimage_file, n_top_img)  # format: img_id img_id dis ...
        print(
            "[%s] %d images and these top %d nearest neighbours with distance loaded from %s"
            % (self.__class__.__name__, len(
                self.img2nnimgdis), n_top_img, nnimage_file))

        # load query info with click of images
        self.img2query_clc = readImageClickture(
            imgClick_file, n_top_query)  # format: img_id /t query /t click ...
        print("[%s] %d images and these %d queris with click loaded from %s" %
              (self.__class__.__name__, len(
                  self.img2query_clc), n_top_query, imgClick_file))

        self.qrySimer = getQuerySimer(qrysim)