Skip to content

Commit

Permalink
Update plots.py
Browse files Browse the repository at this point in the history
Error running python detect.py --visualize
ultralytics#5503
  • Loading branch information
ys31jp authored Nov 5, 2021
1 parent 99a45ba commit 56535ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,5 +443,7 @@ def feature_visualization(x, module_type, stage, n=32, save_dir=Path('runs/detec
ax[i].axis('off')

print(f'Saving {save_dir / f}... ({n}/{channels})')
plt.savefig(save_dir / f, dpi=300, bbox_inches='tight')
if not os.path.exists(save_dir):
os.makedirs(save_dir)
plt.savefig('{}/{}.png'.format(save_dir, f), dpi=300, bbox_inches='tight')
plt.close()

0 comments on commit 56535ba

Please sign in to comment.