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

Avoid the problem that dataloader cannot end iteration normally

上级 c895a7ab
......@@ -19,7 +19,6 @@ import cv2
import paddle
import PIL
import numpy as np
import matplotlib as plt
import paddle.nn.functional as F
from scipy.sparse import csr_matrix
......@@ -107,6 +106,10 @@ def draw_boxes_on_image(image_path: str,
score_thresh: float = 0.5,
save_path: str = 'result'):
"""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))
plt.figure()
_, ax = plt.subplots(1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册