|
@@ -95,6 +95,14 @@ def show_line(img, pred, epoch, writer):
|
|
|
|
|
|
|
|
PLTOPTS = {"color": "#33FFFF", "s": 15, "edgecolors": "none", "zorder": 5}
|
|
PLTOPTS = {"color": "#33FFFF", "s": 15, "edgecolors": "none", "zorder": 5}
|
|
|
# print(f'pred[1]:{pred[1]}')
|
|
# print(f'pred[1]:{pred[1]}')
|
|
|
|
|
+ heatmaps=pred[-2][0]
|
|
|
|
|
+ print(f'heatmaps:{heatmaps.shape}')
|
|
|
|
|
+ jmap = heatmaps[1: 2].cpu().detach()
|
|
|
|
|
+ lmap = heatmaps[2: 3].cpu().detach()
|
|
|
|
|
+ writer.add_image("z-jmap", jmap, epoch)
|
|
|
|
|
+ writer.add_image("z-lmap", lmap, epoch)
|
|
|
|
|
+ # plt.imshow(lmap)
|
|
|
|
|
+ # plt.show()
|
|
|
H = pred[-1]['wires']
|
|
H = pred[-1]['wires']
|
|
|
lines = H["lines"][0].cpu().numpy() / 128 * im.shape[:2]
|
|
lines = H["lines"][0].cpu().numpy() / 128 * im.shape[:2]
|
|
|
scores = H["score"][0].cpu().numpy()
|
|
scores = H["score"][0].cpu().numpy()
|
|
@@ -108,7 +116,7 @@ def show_line(img, pred, epoch, writer):
|
|
|
diag = (im.shape[0] ** 2 + im.shape[1] ** 2) ** 0.5
|
|
diag = (im.shape[0] ** 2 + im.shape[1] ** 2) ** 0.5
|
|
|
nlines, nscores = postprocess(lines, scores, diag * 0.01, 0, False)
|
|
nlines, nscores = postprocess(lines, scores, diag * 0.01, 0, False)
|
|
|
|
|
|
|
|
- for i, t in enumerate([0.001]):
|
|
|
|
|
|
|
+ for i, t in enumerate([0]):
|
|
|
plt.gca().set_axis_off()
|
|
plt.gca().set_axis_off()
|
|
|
plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
|
|
plt.subplots_adjust(top=1, bottom=0, right=1, left=0, hspace=0, wspace=0)
|
|
|
plt.margins(0, 0)
|
|
plt.margins(0, 0)
|
|
@@ -138,4 +146,4 @@ def show_line(img, pred, epoch, writer):
|
|
|
|
|
|
|
|
img2 = transforms.ToTensor()(img_rgb)
|
|
img2 = transforms.ToTensor()(img_rgb)
|
|
|
|
|
|
|
|
- writer.add_image("z-output", img2, epoch)
|
|
|
|
|
|
|
+ writer.add_image("z-output", img2, epoch)
|