Comments (3)
Sorry for my bad English
from mvsnet_pytorch.
@zs670980918
你好,MVSNet网络用于模型训练的深度图gt是由mesh渲染得到的,这使得深度图gt并不是每个像素都有深度值的。在网络模型训练过程中,只有valid_pixels区域预测的深度值才参与loss的计算。
depth_visual.png文件中黑白颜色即代表是否为存在深度值,depth_visual.png文件是通过depth_gt得到的,程序中mask就是通过读取depth_visual.png文件得到的。
MVSNet_pytorch/datasets/dtu_yao.py
Line 86 in e0f2ae3
MVSNet_pytorch/datasets/dtu_yao.py
Line 101 in e0f2ae3
from mvsnet_pytorch.
@zs670980918
你好,MVSNet网络用于模型训练的深度图gt是由mesh渲染得到的,这使得深度图gt并不是每个像素都有深度值的。在网络模型训练过程中,只有valid_pixels区域预测的深度值才参与loss的计算。
depth_visual.png文件中黑白颜色即代表是否为存在深度值,depth_visual.png文件是通过depth_gt得到的,程序中mask就是通过读取depth_visual.png文件得到的。
MVSNet_pytorch/datasets/dtu_yao.py
Line 86 in e0f2ae3
MVSNet_pytorch/datasets/dtu_yao.py
Line 101 in e0f2ae3
你好,感谢你的回复,这部分的代码我基本已经看懂了,我最近也结合着原来的tensorflow版本代码进行也阅读,但是我发现好像原tensorflow版本的代码好像在loss计算中没有涉及使用到数据集中的mask,如下:
loss.py
def non_zero_mean_absolute_diff(y_true, y_pred, interval):
""" non zero mean absolute loss for one batch """
with tf.name_scope('MAE'):
shape = tf.shape(y_pred)
interval = tf.reshape(interval, [shape[0]])
mask_true = tf.cast(tf.not_equal(y_true, 0.0), dtype='float32')
denom = tf.reduce_sum(mask_true, axis=[1, 2, 3]) + 1e-7
masked_abs_error = tf.abs(mask_true * (y_true - y_pred)) # 4D
masked_mae = tf.reduce_sum(masked_abs_error, axis=[1, 2, 3]) # 1D
masked_mae = tf.reduce_sum((masked_mae / interval) / denom) # 1
return masked_mae
def mvsnet_regression_loss(estimated_depth_image, depth_image, depth_interval):
""" compute loss and accuracy """
# non zero mean absulote loss
masked_mae = non_zero_mean_absolute_diff(depth_image, estimated_depth_image, depth_interval)
# less one accuracy
less_one_accuracy = less_one_percentage(depth_image, estimated_depth_image, depth_interval)
# less three accuracy
less_three_accuracy = less_three_percentage(depth_image, estimated_depth_image, depth_interval)
return masked_mae, less_one_accuracy, less_three_accuracy
train.py
# regression loss
loss0, less_one_temp, less_three_temp = mvsnet_regression_loss(
depth_map, depth_image, depth_interval)
loss1, less_one_accuracy, less_three_accuracy = mvsnet_regression_loss(
refined_depth_map, depth_image, depth_interval)
loss = (loss0 + loss1) / 2
根据上面的代码,我好想感觉它是根据深度间隔和GT深度计算得到的maksed_mae。
重新描述一下我的问题:
我看pytorch版本的代码直接使用到了数据集中mask,我想确认原始代码是否也用到了,因为根据我看了一下tensorflow版本的代码,好像不是直接用mask的。我想知道这个mask的使用是pytorch的作者自己创新写上去吗? 还是我自己太菜没有看懂原代码。如果我说的哪里有问题希望能够理解。十分感谢
from mvsnet_pytorch.
Related Issues (20)
- where is the file of test.sh? HOT 3
- CUDA error: unknown error when run train.sh
- 请问怎么训练和测试eth3d数据集呢?
- RuntimeError: Tensors must have same number of dimensions: got 4 and 3? HOT 1
- RuntimeError: Tensors must have same number of dimensions: got 4 and 3 HOT 2
- On the Problem of Calculating the Variance of cost volume HOT 1
- Have anyone checked RMVSNet-Pytorch repository?
- 1080Ti测试显存溢出 HOT 2
- how to solve the error "OSError : unrecognized data stream conntents when reading image file"? HOT 1
- About loss HOT 1
- Floating point exception(core dumped)
- 代码中的matlab问题 HOT 10
- About `Thres_metrics` HOT 4
- 训练UserWarning
- Question about loss function
- 预训练模型
- 测试结果深度图不正确
- how to create a logdir called checkpoints
- Reference image
- Questions about the meaning of grid in the F.grid_sample function.
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 mvsnet_pytorch.