提交 985bff27 编写于 作者: K Kentaro Wada
上级 66e26350
......@@ -4,9 +4,6 @@ import os
import os.path as osp
import warnings
import matplotlib
matplotlib.use('Agg')
import numpy as np
import PIL.Image
import yaml
......
......@@ -76,6 +76,9 @@ def polygons_to_mask(img_shape, polygons):
def draw_label(label, img, label_names, colormap=None):
backend_org = plt.rcParams['backend']
plt.switch_backend('agg')
plt.subplots_adjust(left=0, right=1, top=1, bottom=0,
wspace=0, hspace=0)
plt.margins(0, 0)
......@@ -103,6 +106,8 @@ def draw_label(label, img, label_names, colormap=None):
plt.cla()
plt.close()
plt.switch_backend(backend_org)
out_size = (img.shape[1], img.shape[0])
out = PIL.Image.open(f).resize(out_size, PIL.Image.BILINEAR).convert('RGB')
out = np.asarray(out)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册