Unverified 提交 7215a0fb authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Avoid cv2 window init code on Windows (#8712)

上级 0ab303b0
......@@ -26,6 +26,7 @@ Usage - formats:
import argparse
import os
import platform
import sys
from pathlib import Path
......@@ -173,7 +174,7 @@ def run(
# Stream results
im0 = annotator.result()
if view_img:
if p not in windows:
if platform.system() == 'Linux' and p not in windows:
windows.append(p)
cv2.namedWindow(str(p), cv2.WINDOW_NORMAL | cv2.WINDOW_KEEPRATIO) # allow window resize (Linux)
cv2.resizeWindow(str(p), im0.shape[1], im0.shape[0])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论