This commit is contained in:
Glenn Jocher 2021-12-19 17:08:15 +01:00
parent b5954cc30a
commit 5e09d0424c

View File

@ -245,7 +245,7 @@ def imshow(img, labels=None, pred=None, names=None, nmax=64, verbose=False, f=Pa
ax[i].imshow(blocks[i].squeeze().permute((1, 2, 0))) # cmap='gray'
ax[i].axis('off')
if labels is not None:
s = names[labels[i]] + f'{names[pred[i]]}' if pred is not None else ''
s = names[labels[i]] + (f'{names[pred[i]]}' if pred is not None else '')
ax[i].set_title(s)
plt.savefig(f, dpi=300, bbox_inches='tight')