DevashishPrasad / CascadeTabNet

This repository contains the code and implementation details of the CascadeTabNet paper "CascadeTabNet: An approach for end to end table detection and structure recognition from image-based documents"
MIT License
1.49k stars 427 forks source link

Error: cannot connect to X server #18

Closed man0007 closed 4 years ago

DevashishPrasad commented 4 years ago

If you are using Google Colaboratory (Colab), Then you need to add

from google.colab.patches import cv2_imshow and replace all the cv2.imshow("name",image) with cv2_imshow(image)

man0007 commented 4 years ago

HI,

Thanks for the quick response, I'm running it in the Azure (cloud) linux machine, which is very much equivalent to my local linux machine.

Thanks, Anand.

man0007 commented 4 years ago

Any solution? as i mentioned, i'm not running it in colab but still getting this error?

sekh77 commented 4 years ago

Install an X Server and enable RDP in your Azure Linux VM. Follow this guide -

https://docs.microsoft.com/en-us/azure/virtual-machines/linux/use-remote-desktop.

After you enable RDP, you can use the Windows Remote Desktop Connection to connect to your Azure Linux VM. This will provide you with a full-fledged Desktop screen with all graphical screens. OpenCV cannot show images in a UI if the X server is not configured with proper permissions. Open a Terminal from the Desktop, and issue the following commands from your home folder:

_

chmod 777 .Xauthority chmod 777 .ICEauthority cp .Xauthority .ICEauthority /root

__

Test if the X server is responding by issuing the command - "xclock". If a UI wondow comes up with the clock, then your X server is working. OpenCV can then show results in a UI window.

man0007 commented 4 years ago

After getting the bw image I pressed enter to get the Intersection image, but i could not see any bounding box and the XML is having only 2 rows: https://prnt.sc/sj6k90

xml output:

https://prnt.sc/sj6m4v

should i have to change anything below?

############ To Do ############

image_path = '/datadisk/Shrinidhi/CascadeTabNet-master/Table Structure Recognition/images/table.PNG'

image_path = '/datadisk/Shrinidhi/CascadeTabNet-master/Table Structure Recognition/Examples/cTDaR_t10120.jpg'

xmlPath = '/datadisk/Shrinidhi/CascadeTabNet-master/Table Structure Recognition/xml_fldr/'

config_fname = "/datadisk/Shrinidhi/CascadeTabNet-master/Config/cascade_mask_rcnn_hrnetv2p_w32_20e.py"

checkpoint_path = "/datadisk/Shrinidhi/CascadeTabNet-master/chk_pnt/" epoch = 'General.pth' ##############################

kshitijkapadni commented 4 years ago

can you share the table intersection image?