yijingru / BBAVectors-Oriented-Object-Detection

[WACV2021] Oriented Object Detection in Aerial Images with Box Boundary-Aware Vectors
MIT License
462 stars 87 forks source link

Display issue - Cannot connect to X server :0 #81

Open dineshdaultani opened 3 years ago

dineshdaultani commented 3 years ago

I am getting this error while running the test script on remote docker container.

$ python main.py --data_dir [dataset-test-path] --batch_size 8 --dataset dota --phase test --num_workers 8
loaded weights from weights_dota/model_50.pth, epoch 50
processing 0/1612 image ...
: cannot connect to X server :0

I looked into several blog / stackoverflow but none of the solutions work.

yijingru commented 3 years ago

Hi, it is caused by the display function of OpenCV. You may comment on lines 185-189 in test.py. And add a line to save images, such as cv2.imwrite(os.path.join(save_path, img_id+".png"), np.uint8(ori_image))

dineshdaultani commented 3 years ago

@yijingru , thanks for your quick response. It works after your suggested fix. Maybe we can add this functionality as part of the script through maybe an argument, so that if someone's running the script on docker / without display, will not face this issue. What do you think?