提交 756d321a 编写于 作者: W wuzewu

Avoid the problem that dataloader cannot end iteration normally

上级 c895a7ab
...@@ -19,7 +19,6 @@ import cv2 ...@@ -19,7 +19,6 @@ import cv2
import paddle import paddle
import PIL import PIL
import numpy as np import numpy as np
import matplotlib as plt
import paddle.nn.functional as F import paddle.nn.functional as F
from scipy.sparse import csr_matrix from scipy.sparse import csr_matrix
...@@ -107,6 +106,10 @@ def draw_boxes_on_image(image_path: str, ...@@ -107,6 +106,10 @@ def draw_boxes_on_image(image_path: str,
score_thresh: float = 0.5, score_thresh: float = 0.5,
save_path: str = 'result'): save_path: str = 'result'):
"""Draw boxes on images.""" """Draw boxes on images."""
# On windows, importing paddlenlp and matplotlib at the same time will cause python
# to fail to catch C++ exceptions. Delay matplotlib to avoid this problem.
import matplotlib as plt
image = np.array(PIL.Image.open(image_path)) image = np.array(PIL.Image.open(image_path))
plt.figure() plt.figure()
_, ax = plt.subplots(1) _, ax = plt.subplots(1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册