Comments (1)
def weighted_human_disagreement_rate(gt, pred):
p12_index = select_index(gt)
gt_reshape = np.reshape(gt, gt.size)
pred_reshape = np.reshape(pred, pred.size)
mask = gt > 0
gt_p1 = gt_reshape[mask][p12_index['p1']]
gt_p2 = gt_reshape[mask][p12_index['p2']]
pred_p1 = pred_reshape[mask][p12_index['p1']]
pred_p2 = pred_reshape[mask][p12_index['p2']]
p12_rank_gt = np.zeros_like(gt_p1)
p12_rank_gt[gt_p1>gt_p2] = 1
p12_rank_gt[gt_p1<gt_p2] = -1
p12_rank_pred = np.zeros_like(gt_p1)
p12_rank_pred[pred_p1>pred_p2] = 1
p12_rank_pred[pred_p1<pred_p2] = -1
err = np.sum(p12_rank_gt != p12_rank_pred)
valid_pixels = gt_p1.size
return err, valid_pixels
def select_index(gt_depth, select_size=10000):
valid_size = np.sum(gt_depth>0)
try:
p = np.random.choice(valid_size, select_size*2, replace=False)
except:
p = np.random.choice(valid_size, select_size*2*2, replace=True)
np.random.shuffle(p)
p1 = p[0:select_size*2:2]
p2 = p[1:select_size*2:2]
p12_index = {'p1': p1, 'p2': p2}
return p12_index
whdr_err_sum, eval_num = weighted_human_disagreement_rate(gt_scale, pred_scale)
err = whdr_err_sum / eval_num
from adelaidepth.
Related Issues (20)
- No module named 'lib' error in AdelaiDepth_ResNet101.ipynb HOT 2
- Where to find "SparseTensor"? HOT 1
- Infinit focal length!!! HOT 1
- Error occurred in LeReS HOT 1
- Error on 'Download' step of Google Collab HOT 3
- how to generate depth data like you provide? HOT 1
- About Taskonomy dataset camera camera intrinsics HOT 2
- Need Pretrained Parameters HOT 1
- Torchsparse v1.2.0 vs. v2.1.0 HOT 1
- Visualize with texture. HOT 1
- DIML dataset missing 'disp' data
- some dataset
- Questions about the training resolution and auxiliary network.
- Evaluation samples on ScanNet
- Docker for RTX class GPU for LeReS
- Problem in downloading Weights HOT 3
- Reconstructing the 3D point cloud when the intrinsic is known
- problem with TorchSparse version
- How to get instance planes HOT 1
- Empty .pth of Google Colab HOT 2
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 adelaidepth.