Closed Lucarqi closed 5 months ago
I just correct function 'def __on_save_button_clicked(b)' like this:
def __on_save_button_clicked(b):
plt.savefig("seg_result.png", bbox_inches='tight', pad_inches=0)
if len(self.segs) > 0:
save_seg = np.zeros_like(self.segs[0])
for i, seg in enumerate(self.segs, start=0):
save_seg[seg > 0] = i+1
save_seg = (save_seg - save_seg.min()) / (save_seg.max() - save_seg.min()) * 255
cv2.imwrite("segs.png", save_seg)
print(f"Segmentation result saved to {getcwd()}")
Thanks for your exsellent work. I have tried tutorial_quickstart.ipynb. I run follow cell.
I segment ROI by adding four boxes, like this
I click 'save' botton, but i get the nothing output in 'segs.png' like this:
But in
demo.py
code, class 'BboxPromptDemo' seems save all segment ROI in 'segs.png', in follow partI think maye value integer is small, vscode png viewer cant show any details. So I range save_seg to [0,255]:
I run .ipynp file agian, but I only get first box segment ROI in 'segs.png':