Skip to content

Commit f0dea14

Browse files
[Fix] Fix display bugs for windows (open-mmlab#451)
* fix issue 330 for windows * fix code * fix lint * fix all platform
1 parent 7127096 commit f0dea14

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tools/deploy.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,17 @@ def main():
267267

268268
if args.test_img is None:
269269
args.test_img = args.img
270-
import os
271-
is_display = os.getenv('DISPLAY')
270+
271+
headless = False
272+
# check headless or not for all platforms.
273+
import tkinter
274+
try:
275+
tkinter.Tk()
276+
except Exception:
277+
headless = True
278+
272279
# for headless installation.
273-
if is_display is not None:
280+
if not headless:
274281
# visualize model of the backend
275282
create_process(
276283
f'visualize {backend.value} model',

0 commit comments

Comments
 (0)