Siromanec commited on
Commit
52a0400
·
1 Parent(s): 4bebb57

nan removal

Browse files
Files changed (1) hide show
  1. handcrafted_solution.py +4 -3
handcrafted_solution.py CHANGED
@@ -682,10 +682,11 @@ def predict(entry, visualize=False,
682
  vertices_3d = cv2.transform(cv2.convertPointsToHomogeneous(vertices_3d_local), cam_to_world)
683
  vertices_3d = cv2.convertPointsFromHomogeneous(vertices_3d).reshape(-1, 3)
684
 
685
- # not_nan_items = np.all(~np.isnan(vertices_3d), axis=1)
686
- # _, closest_fitted = points3d_kdtree.query(vertices_3d[not_nan_items])
 
687
 
688
- # vertices_3d[not_nan_items] = points3d_kdtree.data[closest_fitted]
689
 
690
  vert_edge_per_image[i] = vertices, connections, vertices_3d
691
  all_3d_vertices, connections_3d = merge_vertices_3d(vert_edge_per_image, **kwargs)
 
682
  vertices_3d = cv2.transform(cv2.convertPointsToHomogeneous(vertices_3d_local), cam_to_world)
683
  vertices_3d = cv2.convertPointsFromHomogeneous(vertices_3d).reshape(-1, 3)
684
 
685
+ if not depthmap_used:
686
+ not_nan_items = np.all(~np.isnan(vertices_3d), axis=1)
687
+ _, closest_fitted = points3d_kdtree.query(vertices_3d[not_nan_items])
688
 
689
+ vertices_3d[not_nan_items] = points3d_kdtree.data[closest_fitted]
690
 
691
  vert_edge_per_image[i] = vertices, connections, vertices_3d
692
  all_3d_vertices, connections_3d = merge_vertices_3d(vert_edge_per_image, **kwargs)