From a2790eb271e5253cb0622824bf632577e6a915d8 Mon Sep 17 00:00:00 2001 From: Jingxian Ke <102451740+JingxianKe@users.noreply.github.com> Date: Mon, 31 Jul 2023 12:17:23 +0800 Subject: [PATCH] Remove Matplotlib agg backend (#499) * Remove Matplotlib agg backend https://stackoverflow.com/questions/56656777/userwarning-matplotlib-is-currently-using-agg-which-is-a-non-gui-backend-so --- yolort/v5/utils/plots.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/yolort/v5/utils/plots.py b/yolort/v5/utils/plots.py index ba85ab54..0a6b46ea 100644 --- a/yolort/v5/utils/plots.py +++ b/yolort/v5/utils/plots.py @@ -36,8 +36,6 @@ # Settings CONFIG_DIR = user_config_dir() # Ultralytics settings dir RANK = int(os.getenv("RANK", -1)) -matplotlib.rc("font", **{"size": 11}) -matplotlib.use("Agg") # for writing to files only class Colors: @@ -446,7 +444,6 @@ def plot_labels(labels, names=(), save_dir=Path("")): ax[a].spines[s].set_visible(False) plt.savefig(save_dir / "labels.jpg", dpi=200) - matplotlib.use("Agg") plt.close()