def read_external(in_path,short_name=False): text='\n'.join(files.read_file(in_path)) feat_dict=files.txt_to_dict(text) get_features=ExternalFeats(feat_dict,short_name) return get_features
def transform_features(in_path,out_path,extractor): text=files.read_file(in_path,lines=False) feat_dict=files.txt_to_dict(text) data=[imgs.Image(name_i,np.expand_dims(vec_i,1)) for name_i,vec_i in feat_dict.items()] external_features(out_path,data,extractor,array_extr=True)