sunset1995 / HorizonNet

Pytorch implementation of HorizonNet: Learning Room Layout with 1D Representation and Pano Stretch Data Augmentation.
https://sunset1995.github.io/HorizonNet/
MIT License
323 stars 88 forks source link

If inferenced on the non-rectified image (no preprocessing but the wall in the image is vertical), the corners are not correct #22

Open HiPupilxD-Hao opened 4 years ago

HiPupilxD-Hao commented 4 years ago

@sunset1995, thank you for the great work.

I have a question here: it seems the inference corners after post-processing only work on the pre-processed image (rotate by the vp). Is it possible to visualize the corners before the rotation? Cheers.

HiPupilxD-Hao commented 4 years ago

Suppose I have an image that contains the walls vertically in the image. But after the pre-processing, the image is rotated by a certain degree.

When the image is inferenced & post-processed, the corners detected are at the wrong positions if using the non-pre-processed image.

For easier understanding, there is an example: image This is the non-pre-processed image image This is the pre-processed image The pre-processed image is rotated along the x-axis by some degrees.

If only visualized the corners after the inference, they are all looked good. The problem is after the post-processing, i.e. rotating the scene by the avg angle of the PCA. Then the corners detected on the image are shifted.

Here is a screenshot: image

sunset1995 commented 4 years ago

Sorry for late reply. The inference.py with --visualize can visualize the raw output (the probability map) from model. The post-processing implemented here only support pre-processed image.

HiPupilxD-Hao commented 4 years ago

@sunset1995 Hi, thanks for the reply, the visualize argument can be used to visualize the image in 3D space without problem. May I ask how to get the corners from the original image (without pre-processing)?

vlordier commented 4 years ago

Same problem here : points are moved to the left, unsure why

Screenshot 2020-02-12 at 15 47 19
jbyu commented 3 years ago

Same problem here. I found the vote function invalidates all XY corners, then use "best_fit = np.median(vec)". Could you explain how it works? Input: 1561 Result: 1561 raw

zhigangjiang commented 3 years ago

pre-processing is need. in the paper, the author says that the pre-processing algorithm fails will to correctly align the horizontal rotation of the panorama by PCA. so check this rotation of PCA in post_proc.py and inversely use it in the final result. In addition, I think pre-processing also need to rotate the label if annotate it in the original panorama image.