Comments (5)
- Correct. (I expect what you are saying is about the construction of cost volume.)
- Don't need, because we only use cur2prevs when constructing the cost volume and we always recover the plane-sweep feature in the canonical space/real-world space.
from depth-from-motion.
Thanks for all your help. We change the intrinsic matrix K for rescaling,cropping and flipping, conduct horizontal flipping for images, and only flip 3D grid when lifting the 2.5 coordinate to 3D, but the performance appears a little dropping.
from depth-from-motion.
Do you mean passing the adjusted intrinsic matrix into the build_dfm_cost function? If yes, could you please show the code concretely? Maybe you can compare the 3D features obtained in these two different ways.
from depth-from-motion.
Yes. we will try to compare the 3D features obtained in these two different ways. Thank you.
from depth-from-motion.
We find there are still some error in our implication for data augmentation. Our code is shown as follows. We perform random flipping,rescaling and cropping on the input images. P2_ori is the adjusted intrinsic matrix and equals [ 755.64,0,638.37,46.977;0,755.64,76.298,-0.06;0,0,1,0.0027;0,0,0,1] ,When flipping, P2_ori equals [ 755.64,0,638.37,-46.977;0,755.64,76.298,-0.06;0,0,1,0.0027;0,0,0,1]
def forward(self, cur_features, prev_features,P2_ori,cur2prevs):
batch_size = cur_features.shape[0]
num_depths = self.downsampled_depth.shape[-1]
h_out, w_out = cur_features.shape[-2:]
ws = torch.linspace(0, w_out - 1, w_out).cuda()
hs = torch.linspace(0, h_out - 1, h_out).cuda()
ds_3d, ys_3d, xs_3d = torch.meshgrid(self.downsampled_depth, hs, ws)
grid = torch.stack([xs_3d, ys_3d, ds_3d], dim=-1)
grid = grid[None].repeat(batch_size, 1, 1, 1, 1)
prev_cost_feats_list =[]
P2 = P2_ori.clone()
P2[:,0, :] = P2[:,0, :] // self.downsample_scale
P2[:,1, :] = P2[:,1, :] // self.downsample_scale
for idx in range(batch_size):
grid3d = points_img2cam(grid[idx].view(-1, 3), P2[idx][:3])
pad_ones = grid3d.new_ones(grid3d.shape[0], 1)
homo_grid3d = torch.cat([grid3d, pad_ones], dim=1)
prev_grid3d = (homo_grid3d @ cur2prevs[idx].transpose(0, 1))[:, :3]
prev_grid = points_cam2img(prev_grid3d, P2[idx])[:, :2]
prev_grid = prev_grid.view(1, 1, -1, 2)
prev_grid[..., 0] = prev_grid[..., 0] / (w_out - 1) * 2 - 1
prev_grid[..., 1] = prev_grid[..., 1] / (h_out - 1) * 2 - 1
prev_cost_feats = F.grid_sample(
prev_features[idx:idx+1],
prev_grid,
mode='bilinear',
padding_mode='zeros',
align_corners=True) # (B, C, 1, D*H_out*W_out)
prev_cost_feats = prev_cost_feats.view(-1, num_depths, h_out,w_out)
prev_cost_feats_list.append(prev_cost_feats)
prev_cost_feats_list=torch.stack(prev_cost_feats_list) #(B, C, D, H_out, W_out)
cur_cost_feats_list= cur_features.unsqueeze(2).repeat(1,1,num_depths,1,1)
cost = (cur_cost_feats_list*prev_cost_feats_list).mean(dim=1)
from depth-from-motion.
Related Issues (20)
- How to prepare the raw data of KITTI? HOT 3
- some error when running mono_det_demo.py HOT 4
- dfm training error: ValueError: need at least one array to stack HOT 3
- Training error using "./tools/dist_train.sh" HOT 3
- 关于RandomCrop3D实现的问题 HOT 1
- compute_detection_let_metrics_main细节 HOT 1
- Indoor object detection on the way? HOT 1
- cuda execution failed with error 2 HOT 2
- where to get waymo/kitti_format/ImageSets/test_cam_only.txt? HOT 1
- About the checkpoint of FCOS++ HOT 4
- Waymo license about pre-trained model HOT 1
- the use of aggregated volume HOT 4
- Welcome update to OpenMMLab 2.0
- PGD training Waymo Dataset, why set loss_bbox2d weight = 0?
- 关于深度离散化方式
- question about pose-free version
- install issue
- Where is mv-fcos3d++?
- Table 3.中Mono Only HOT 5
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 depth-from-motion.