|
|
@@ -232,26 +232,6 @@ class Trainer(BaseTrainer):
|
|
|
# img_tensor = np.transpose(img_tensor)
|
|
|
self.writer.add_image('z-out-arc', arcs, global_step=epoch)
|
|
|
|
|
|
- aa = result['arcs_point'][0]
|
|
|
-
|
|
|
- x_coords = aa[:, 0].cpu()/800*2000
|
|
|
- y_coords = aa[:, 1].cpu()/800*2000
|
|
|
-
|
|
|
- plt.figure(figsize=(10, 8))
|
|
|
- plt.imshow(im)
|
|
|
- plt.scatter(x_coords, y_coords, c='red', s=0.3, label='Arc Points')
|
|
|
- plt.title("Image with Arc Points")
|
|
|
- plt.legend()
|
|
|
- plt.axis('off')
|
|
|
-
|
|
|
- fig = plt.gcf()
|
|
|
- fig.canvas.draw()
|
|
|
- image_from_plot = np.frombuffer(fig.canvas.tostring_rgb(), dtype=np.uint8)
|
|
|
- image_from_plot = image_from_plot.reshape(fig.canvas.get_width_height()[::-1] + (3,)) # H x W x 3
|
|
|
- plt.close()
|
|
|
-
|
|
|
- self.writer.add_image('z-out-result', image_from_plot, dataformats='HWC')
|
|
|
-
|
|
|
# cv2.imshow('arc', img_rgb)
|
|
|
# cv2.waitKey(1000000)
|
|
|
|