Giter Site home page Giter Site logo

Comments (15)

coldmanck avatar coldmanck commented on June 12, 2024 1

So what's the right way to test on any images? This issue seems to be not solved yet.

from vnl_monocular_depth_prediction.

CVDOU avatar CVDOU commented on June 12, 2024 1

Can you provide an example to show how to test? It seems using current codes cannot succeed testing.

from vnl_monocular_depth_prediction.

YvanYin avatar YvanYin commented on June 12, 2024 1

Do you use the script ./tools/test_any_images.py?
Can you check the following parts?

  1. Have you successfully loaded the trained model?
  2. check any pixel location of pred_depth_softmax, which is in the shape of [1, 150, w, h]. The sum of 150 channels should be 1. And you can also see that the probability of one channel is much bigger than the others.

I updated the code again. Please git the latest one.
Run the following code to test any images.
python ./tools/test_any_images.py
--dataroot ./
--dataset any
--cfg_file lib/configs/resnext101_32x4d_nyudv2_class
--load_ckpt ./nyu_rawdata.pth

from vnl_monocular_depth_prediction.

kHarshit avatar kHarshit commented on June 12, 2024 1

Update: Solved it. had to add it to PYTHONPATH, not PATH.

Hey @YvanYin, I'm getting

Traceback (most recent call last):
  File "./tools/test_any_images.py", line 5, in <module>
    from lib.utils.net_tools import load_ckpt
ModuleNotFoundError: No module named 'lib'

even after adding the VNL lib directory to PATH like this:
export PATH=/nfs/interns/kharshit/DepthEstimation/VNL_Monocular_Depth_Prediction/lib/:$PATH

from vnl_monocular_depth_prediction.

YvanYin avatar YvanYin commented on June 12, 2024

Hi,
the output channel of kitti model is 100. This output will be processed by function "bins_to_depth" to transfer depth bins to a one channel depth.
You can test any images with test_any_images.py.

from vnl_monocular_depth_prediction.

xwjBupt avatar xwjBupt commented on June 12, 2024

hi,thanks for your reply , i tried to use the "bins_to_depth" function,but the pixels in result depth image are all zero,what should i do ? the following is the your code i changed a lit bit or i will show error:

            img_torch = scale_torch(img, 255)

            img_torch = img_torch[None, :, :, :].cuda()

            pred_depth, pred_depth_softmax = model.depth_model(img_torch)
            # pred_depth = pred_depth.cpu().numpy().squeeze()
            # pred_depth_scale = (pred_depth / pred_depth.max() * 60000).astype(np.uint16)
            
            
            pred_depth_scale = (pred_depth / pred_depth.max() * 60000)
            depth_map = own_bins_to_depth(pred_depth_scale)
            depth_map = depth_map.cpu().numpy()[0][0]
            plt.imshow(depth_map)
            plt.show()
           

from vnl_monocular_depth_prediction.

YvanYin avatar YvanYin commented on June 12, 2024

Hi, can you send me your predicted results? or send me your tested images?

from vnl_monocular_depth_prediction.

xwjBupt avatar xwjBupt commented on June 12, 2024

hi!can i send your through email? what is your email address? thankd you!

from vnl_monocular_depth_prediction.

YvanYin avatar YvanYin commented on June 12, 2024

My email is [email protected].

from vnl_monocular_depth_prediction.

fire17 avatar fire17 commented on June 12, 2024

Hey im also trying to run test_any_images
getting an error
Traceback (most recent call last):
File "test_any_images.py", line 82, in
cv2.imwrite((pathS + 'raw'+str(c)+'.png'), pred_depth_scale)
cv2.error: OpenCV(4.1.0) /io/opencv/modules/imgcodecs/src/loadsave.cpp:667: error: (-215:Assertion failed) image.channels() == 1 || image.channels() == 3 || image.channels() == 4 in function 'imwrite_'

shape of pred_depth_scale is (150, 370, 370)

please help

from vnl_monocular_depth_prediction.

fire17 avatar fire17 commented on June 12, 2024

hi,thanks for your reply , i tried to use the "bins_to_depth" function,but the pixels in result depth image are all zero,what should i do ? the following is the your code i changed a lit bit or i will show error:

            img_torch = scale_torch(img, 255)

            img_torch = img_torch[None, :, :, :].cuda()

            pred_depth, pred_depth_softmax = model.depth_model(img_torch)
            # pred_depth = pred_depth.cpu().numpy().squeeze()
            # pred_depth_scale = (pred_depth / pred_depth.max() * 60000).astype(np.uint16)
            
            
            pred_depth_scale = (pred_depth / pred_depth.max() * 60000)
            depth_map = own_bins_to_depth(pred_depth_scale)
            depth_map = depth_map.cpu().numpy()[0][0]
            plt.imshow(depth_map)
            plt.show()
           

tried as xwjBupt suggested, saves us from error,
but also getting almost all 0 black image
and it takes wayyyyy longer with bins_to_depth

how do we get to vis/save pred_depth_scale properly??

from vnl_monocular_depth_prediction.

YvanYin avatar YvanYin commented on June 12, 2024

Hi all,
I am so sorry for replying so late. I have modified the ./tools/test_any_images.py. I provide some images for testing under ./test_any_images_examples.

All the problems are that the output from model.depth_model(img_torch) should be processed by the bins_to_depth. This function will transfer the depth bins, which have 150 channels, to a 1 channel depth map.
The input for the bins_to_depth should be the pred_depth_softmax not the pred_depth.

from vnl_monocular_depth_prediction.

CVDOU avatar CVDOU commented on June 12, 2024

Hi all,
I am so sorry for replying so late. I have modified the ./tools/test_any_images.py. I provide some images for testing under ./test_any_images_examples.

All the problems are that the output from model.depth_model(img_torch) should be processed by the bins_to_depth. This function will transfer the depth bins, which have 150 channels, to a 1 channel depth map.

Thanks for reply. I test as your suggestion, however, I still can't get the same results as provided. My results are shown below. The only difference is that I comment the code lines about dataset, as I don't have the NYU dataset.

26_r-raw
107_r-raw

from vnl_monocular_depth_prediction.

CVDOU avatar CVDOU commented on June 12, 2024

Do you use the script ./tools/test_any_images.py?
Can you check the following parts?

  1. Have you successfully loaded the trained model?
  2. check any pixel location of pred_depth_softmax, which is in the shape of [1, 150, w, h]. The sum of 150 channels should be 1. And you can also see that the probability of one channel is much bigger than the others.

I updated the code again. Please git the latest one.
Run the following code to test any images.
python ./tools/test_any_images.py
--dataroot ./
--dataset any
--cfg_file lib/configs/resnext101_32x4d_nyudv2_class
--load_ckpt ./nyu_rawdata.pth

Great. The reason is that the model isn't loaded. I can get the same results.

from vnl_monocular_depth_prediction.

Bill-Ren avatar Bill-Ren commented on June 12, 2024

how can I test on a single image? I follow your steps, but it still has errors, it seems that the code can only test on dataset with labels?

from vnl_monocular_depth_prediction.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.