未验证 提交 4bde18a1 编写于 作者: T Timo 提交者: GitHub

Fix the incompatibility of gif saving

When cv2.imwirte() saves ".gif", it will cause _error: (-2:Unspecified error) could not find a writer for the specified extension in function 'cv::imwrite_'_. We add an if statement to check whether the saving file format is ".gif" so as to avoid the error.
上级 cfdefbe1
......@@ -176,6 +176,8 @@ def main(args):
draw_img_save = "./inference_results/"
if not os.path.exists(draw_img_save):
os.makedirs(draw_img_save)
if flag:
image_file = image_file[:-3] + "png"
cv2.imwrite(
os.path.join(draw_img_save, os.path.basename(image_file)),
draw_img[:, :, ::-1])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册