(sender, app_data)
| 646 | with dpg.group(horizontal=True): |
| 647 | |
| 648 | def callback_save_current_view(sender, app_data): |
| 649 | # res_mask, pred_image = self.guidance_res.predict_res_mask(out_image.cpu(), prompt) |
| 650 | # mask_out_expand = res_mask.expand_as(pred_image) |
| 651 | # viz_images = torch.cat([pred_image.unsqueeze(0) ,mask_out_expand.unsqueeze(0)],dim=0) |
| 652 | # save_image(viz_images, "testfolder/"+ prompt + ".png") |
| 653 | |
| 654 | os.makedirs(self.workspace, exist_ok=True) |
| 655 | |
| 656 | tensor_img = torch.from_numpy( |
| 657 | self.buffer_image).permute(2, 0, 1) |
| 658 | save_path = os.path.join(self.workspace, |
| 659 | self.save_view_name + ".png") |
| 660 | save_image(tensor_img, save_path) |
| 661 | # save rgba |
| 662 | tensor_img_rgba = torch.cat( |
| 663 | [tensor_img, self.buffer_alpha], |
| 664 | dim=0) |
| 665 | save_path = os.path.join(self.workspace, |
| 666 | self.save_view_name + "_rgba.png") |
| 667 | save_image(tensor_img_rgba, save_path) |
| 668 | print("Current view saved in:", save_path) |
| 669 | |
| 670 | dpg.add_text("View Saving Path: ") |
| 671 | dpg.add_button(label="save", |
nothing calls this directly
no outgoing calls
no test coverage detected