def _send_output_signals(self, embeddings): embedded_images, skipped_images, num_skipped =\ ImageEmbedder.prepare_output_data(self._input_data, embeddings) self.Outputs.embeddings.send(embedded_images) self.Outputs.skipped_images.send(skipped_images) if num_skipped is not 0: self.input_data_info.setText( "Data with {:d} instances, {:d} images skipped.".format( len(self._input_data), num_skipped))
def _send_output_signals(self, embeddings): embedded_images, skipped_images, num_skipped =\ ImageEmbedder.prepare_output_data(self._input_data, embeddings) self.Outputs.embeddings.send(embedded_images) self.Outputs.skipped_images.send(skipped_images) if num_skipped is not 0: self.input_data_info.setText( "Data with {:d} instances, {:d} images skipped.".format( len(self._input_data), num_skipped))
def _send_output_signals(self, embeddings): embedded_images, skipped_images, num_skipped =\ ImageEmbedder.prepare_output_data(self._input_data, embeddings) self.send(_Output.SKIPPED_IMAGES, skipped_images) self.send(_Output.EMBEDDINGS, embedded_images) if num_skipped is not 0: self.input_data_info.setText( "Data with {:d} instances, {:d} images skipped.".format( len(self._input_data), num_skipped))
mycol.update_one({"client_id":upload.cid2},{"$set": { "metadata.features": emb_up[0]}}) #retrieving the just stored featues again myquery = {"client_id":upload.cid2} mydoc = mycol.find(myquery) for x in mydoc: embeddings[u] = x["metadata"] data_2 = data #getting embeddings for each image as a key value pair values = [] for dictionary in embeddings: values.extend([v for k, v in dictionary.items()]) data2 = ImageEmbedder.prepare_output_data(data_2, values) out_data = data2[0] #selection of distance algorithm by user d_algo = upload.distance_algo # computing distance among images from Orange.distance import Cosine, Euclidean dist = data2[0] if(d_algo == 'Cosine'): dist_matrix = Cosine(dist) else: dist_matrix = Euclidean(dist)