def lab_info_save_all_blocks(self): output_path = tkFileDialog.asksaveasfilename() if not self.server.lab_key: showwarning("Load Config", "You need to load the config.json first") return payload = {"lab_key": self.server.lab_key} resp = requests.post(self.server.get_all_labels_url, json=payload, allow_redirects=False) block_data = None if resp.ok: block_data = json.loads(resp.content) blocks = [] if block_data: for block_group in block_data: for block in block_group["blocks"]: blocks.append(idsblocks.json_to_block(block)) idsblocks.save_blocks_to_csv(blocks, output_path)
def lab_info_save_reliability_blocks(self): output_path = tkFileDialog.asksaveasfilename() if not self.server.lab_key: showwarning("Load Config", "You need to load the config.json first") return payload = {"lab_key": self.server.lab_key} resp = requests.post(self.server.get_relia_labels_url, json=payload, allow_redirects=False) block_data = None if resp.ok: block_data = json.loads(resp.content) blocks = [] for block in block_data: blocks.append(idsblocks.json_to_block(block)) idsblocks.save_blocks_to_csv(blocks, output_path)
def lab_info_save_this_block(self): output_path = tkFileDialog.asksaveasfilename() idsblocks.save_blocks_to_csv([self.curr_past_block], output_path)
def output_classifications(self): if not self.classification_output: self.classification_output = tkFileDialog.asksaveasfilename() idsblocks.save_blocks_to_csv([self.current_block], self.classification_output)