Comments (15)
So what's the right way to test on any images? This issue seems to be not solved yet.
from vnl_monocular_depth_prediction.
Can you provide an example to show how to test? It seems using current codes cannot succeed testing.
from vnl_monocular_depth_prediction.
Do you use the script ./tools/test_any_images.py?
Can you check the following parts?
- Have you successfully loaded the trained model?
- 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.
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.
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.
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.
Hi, can you send me your predicted results? or send me your tested images?
from vnl_monocular_depth_prediction.
hi!can i send your through email? what is your email address? thankd you!
from vnl_monocular_depth_prediction.
My email is [email protected].
from vnl_monocular_depth_prediction.
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.
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.
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.
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.
from vnl_monocular_depth_prediction.
Do you use the script ./tools/test_any_images.py?
Can you check the following parts?
- Have you successfully loaded the trained model?
- 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.
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)
- Error while loading the model HOT 1
- How makew
- How make inference on single image? HOT 3
- Only can train 1 epoch? HOT 3
- Setting for training in ablation study HOT 1
- Some questions about surface normal estimation and robutness test HOT 3
- Might it be a small false figure reference of the paper uploaded on Arxiv? HOT 1
- how can I train with NYUD-V2 dataset HOT 1
- About the Camera Parameters HOT 2
- How can I generate the dense ground truth depth maps in KITTI? HOT 6
- How to generate a point cloud map? HOT 1
- Error when running train_kitti_metric.py HOT 1
- pretaind resnext101_32x4d.pth HOT 2
- abs_rel value
- yaml_cfg load error HOT 1
- Could you please provide the pretrain model of moblinenetv2? HOT 1
- The test_any_image file cannot correct output img and the test_nyu file output very bad quality image! HOT 2
- Questions about datasets
- How to understand the concept of convert depth to Point Cloud
- can't download any pretrained weights HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vnl_monocular_depth_prediction.