Hanqer / deep-hough-transform

Jittor and Pytorch code for paper "Deep Hough Transform for Semantic Line Detection" (ECCV 2020, PAMI 2021)
344 stars 71 forks source link

Want to test images, but the output of pretrained model is same, and .npy is empty, don't know why #13

Closed lucyLLLL closed 3 years ago

lucyLLLL commented 3 years ago

python forward.py --model /home/wh/LX/deep-hough-transform/dht_r50_nkl_d97b97138.pth --tmp result --align forward.py:34: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. CONFIGS = yaml.load(open(args.config)) 2021-06-19 21:44:12,674 INFO Namespace(align=True, config='./config.yml', model='/home/wh/LX/deep-hough-transform/dht_r50_nkl_d97b97138.pth', tmp='result') 2021-06-19 21:44:14,885 INFO => loading pretrained model '/home/wh/LX/deep-hough-transform/dht_r50_nkl_d97b97138.pth' 2021-06-19 21:44:14,981 INFO => loaded checkpoint '/home/wh/LX/deep-hough-transform/dht_r50_nkl_d97b97138.pth' 2021-06-19 21:44:14,982 INFO Data loading done. 2021-06-19 21:44:14,982 INFO Start testing. 0%| | 0/1 [00:00<?, ?it/s]/home/wh/anaconda3/envs/dht/lib/python3.7/site-packages/torch/nn/functional.py:2351: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead. warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.") /home/wh/anaconda3/envs/dht/lib/python3.7/site-packages/torch/nn/functional.py:2423: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. "See the documentation of nn.Upsample for details.".format(mode)) key_points tensor([[[[-21.1735, -17.2324, -17.1631, ..., -17.6154, -17.7940, -21.5696], [-22.0821, -20.7443, -22.0057, ..., -22.1724, -20.9939, -22.0742], [-22.0821, -20.7443, -22.0057, ..., -22.1724, -20.9939, -22.0742], ..., [-22.0821, -20.7443, -22.0057, ..., -22.1724, -20.9939, -22.0742], [-22.0821, -20.7443, -22.0057, ..., -22.1724, -20.9939, -22.0742], [-21.3498, -17.6830, -17.8845, ..., -18.3267, -18.3589, -22.4652]]]], device='cuda:0') key_points tensor([[[[6.3746e-10, 3.2814e-08, 3.5167e-08, ..., 2.2374e-08, 1.8713e-08, 4.2897e-10], [2.5696e-10, 9.7915e-10, 2.7737e-10, ..., 2.3477e-10, 7.6293e-10, 2.5900e-10], [2.5696e-10, 9.7915e-10, 2.7737e-10, ..., 2.3477e-10, 7.6293e-10, 2.5900e-10], ..., [2.5696e-10, 9.7915e-10, 2.7737e-10, ..., 2.3477e-10, 7.6293e-10, 2.5900e-10], [2.5696e-10, 9.7915e-10, 2.7737e-10, ..., 2.3477e-10, 7.6293e-10, 2.5900e-10], [5.3442e-10, 2.0911e-08, 1.7095e-08, ..., 1.0985e-08, 1.0637e-08, 1.7518e-10]]]], device='cuda:0') binary_kmap [[False False False ... False False False] [False False False ... False False False] [False False False ... False False False] ... [False False False ... False False False] [False False False ... False False False] [False False False ... False False False]] len(b_points) 0 100%|█████████████████████████████████████████████| 1/1 [00:00<00:00, 3.77it/s] forward time for total images: 0.088414 post-processing time for total images: 0.063351 2021-06-19 21:44:15,296 INFO Test done! Total 1 imgs at 0.1518 secs without image io, fps: 6.589

zeakey commented 3 years ago

@Hanqer any help to this issue?

Hanqer commented 3 years ago

I test the main branch of the released code. It is correct for the NKL test set. If you are using your own test images, please carefully handle the image path. By the way, if you use the '--align' for post-processing, you should prepare the edge detection results such as HED, as described in the paper.

zeakey commented 3 years ago

Please refer to https://github.com/Hanqer/deep-hough-transform/blob/master/test.md for detailed steps about testing.


We verified on a fresh environment and everything is okay.

Our environment is (output from pip freeze):

addict==2.4.0
certifi==2021.5.30
cycler==0.10.0
Cython==0.29.24
deep-hough==0.0.0
fastrlock==0.6
imageio==2.9.0
kiwisolver==1.3.2
matplotlib==3.4.3
mkl-fft==1.3.0
mkl-random @ file:///tmp/build/80754af9/mkl_random_1626179032232/work
mkl-service==2.4.0
networkx==2.6.3
numpy @ file:///tmp/build/80754af9/numpy_and_numpy_base_1626264701743/work
olefile==0.46
opencv-python==4.5.3.56
packaging==21.0
Pillow @ file:///tmp/build/80754af9/pillow_1625655818400/work
POT==0.7.0
pyparsing==2.4.7
python-dateutil==2.8.2
PyWavelets==1.1.1
PyYAML==5.4.1
scikit-image==0.18.3
scipy==1.7.1
six @ file:///tmp/build/80754af9/six_1623709665295/work
termcolor==1.1.0
tifffile==2021.8.30
torch==1.9.0
torchaudio==0.9.0a0+33b2469
torchvision==0.10.0
tqdm==4.62.2
typing-extensions @ file:///tmp/build/80754af9/typing_extensions_1624965014186/work
yacs==0.1.8
yapf==0.31.0

If you run into the same problem, please verify your environment. If the problem still exists, please leave a message here in this issue.