Skip to content

Commit

Permalink
Update plots.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Zengyf-CVer authored and glenn-jocher committed Nov 21, 2021
1 parent 631f9e7 commit a6a0c76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ def feature_visualization(x, module_type, stage, n=32, save_dir=Path('runs/detec
ax[i].imshow(blocks[i].squeeze()) # cmap='gray'
ax[i].axis('off')

block_arrary = blocks[i].squeeze().numpy() # tensor2numpy
if not os.path.exists(f'{save_dir}/{f2}'): # mkdir npy
block_arrary = blocks[i].squeeze().numpy() # tensor2numpy
if not os.path.exists(f'{save_dir}/{f2}'): # mkdir npy
os.makedirs(f'{save_dir}/{f2}')
np.save(f'{save_dir}/{f2}/{f2}_{i}.npy', block_arrary) # npy save
np.save(f'{save_dir}/{f2}/{f2}_{i}.npy', block_arrary) # npy save
print(f'Saving {save_dir / f}... ({n}/{channels})')
plt.savefig(save_dir / f, dpi=300, bbox_inches='tight')
plt.close()
Expand Down

0 comments on commit a6a0c76

Please sign in to comment.