def _features_to_hasher(self, hasher, input_table, input_column, output_table, output_row, output_column, **kw): row_dict = hadoopy_hbase.HBaseRowDict(output_table, output_column, db=self.hb) features = hadoopy_hbase.scanner_column(self.hb, input_table, input_column, **kw) row_dict[output_row] = features_to_hasher(hasher, features)
def features_to_hasher(self, feature_key, hasher, **kw): features = hadoopy_hbase.scanner_column(self.hb, self.images_table, feature_key, **kw) hasher = hasher.train(picarus.api.np_fromstring(x) for x in features) k = image_retrieval.input_model_param_to_key('hash:', input={'feature': feature_key}, model=hasher) print(repr(k)) return k
def hasher_train(model_dict, model_param, inputs): hasher = call_import(model_dict) features = hadoopy_hbase.scanner_column(thrift, self.table, inputs['feature'], start_row=start_row, stop_row=stop_row) return hasher.train(picarus.api.np_fromstring(x) for x in features)