def test_SemanticKITTISCN(): from xmuda.data.utils.visualize import draw_points_image_labels, draw_bird_eye_view preprocess_dir = '/datasets_local/datasets_mjaritz/semantic_kitti_preprocess/preprocess' semantic_kitti_dir = '/datasets_local/datasets_mjaritz/semantic_kitti_preprocess' # pselab_paths = ("/home/docker_user/workspace/outputs/xmuda/a2d2_semantic_kitti/xmuda_crop_resize/pselab_data/train.npy",) # split = ('train',) split = ('val',) dataset = SemanticKITTISCN(split=split, preprocess_dir=preprocess_dir, semantic_kitti_dir=semantic_kitti_dir, # pselab_paths=pselab_paths, merge_classes=True, noisy_rot=0.1, flip_y=0.5, rot_z=2*np.pi, transl=True, bottom_crop=(480, 302), fliplr=0.5, color_jitter=(0.4, 0.4, 0.4) ) for i in [10, 20, 30, 40, 50, 60]: data = dataset[i] coords = data['coords'] seg_label = data['seg_label'] img = np.moveaxis(data['img'], 0, 2) img_indices = data['img_indices'] # pseudo_label_2d = data['pseudo_label_2d'] draw_points_image_labels(img, img_indices, seg_label, color_palette_type='SemanticKITTI', point_size=1) # draw_points_image_labels(img, img_indices, pseudo_label_2d, color_palette_type='SemanticKITTI', point_size=1) # assert len(pseudo_label_2d) == len(seg_label) draw_bird_eye_view(coords)
def test_A2D2SCN(): from xmuda.data.utils.visualize import draw_points_image_labels, draw_bird_eye_view preprocess_dir = '/datasets_local/datasets_mjaritz/a2d2_preprocess' split = ('test',) dataset = A2D2SCN(split=split, preprocess_dir=preprocess_dir, merge_classes=True, use_image=True, noisy_rot=0.1, flip_y=0.5, rot_z=2*np.pi, transl=True, fliplr=0.5, color_jitter=(0.4, 0.4, 0.4) ) for i in [10, 20, 30, 40, 50, 60]: data = dataset[i] coords = data['coords'] seg_label = data['seg_label'] img = np.moveaxis(data['img'], 0, 2) img_indices = data['img_indices'] draw_points_image_labels(img, img_indices, seg_label, color_palette_type='SemanticKITTI', point_size=3) draw_bird_eye_view(coords)
def test_NuScenesSCN(): from xmuda.data.utils.visualize import draw_points_image_labels, draw_points_image_depth, draw_bird_eye_view preprocess_dir = '/datasets_local/datasets_mjaritz/nuscenes_preprocess/preprocess' nuscenes_dir = '/datasets_local/datasets_mjaritz/nuscenes_preprocess' # split = ('train_singapore',) # pselab_paths = ('/home/docker_user/workspace/outputs/xmuda/nuscenes/usa_singapore/xmuda/pselab_data/train_singapore.npy',) split = ('train_night', ) # pselab_paths = ('/home/docker_user/workspace/outputs/xmuda/nuscenes/day_night/xmuda/pselab_data/train_night.npy',) dataset = NuScenesSCN( split=split, preprocess_dir=preprocess_dir, nuscenes_dir=nuscenes_dir, # pselab_paths=pselab_paths, merge_classes=True, use_image=True, noisy_rot=0.1, flip_x=0.5, rot_z=2 * np.pi, transl=True, fliplr=0.5, color_jitter=(0.4, 0.4, 0.4)) for i in [10, 20, 30, 40, 50, 60]: data = dataset[i] coords = data['coords'] seg_label = data['seg_label'] img = np.moveaxis(data['img'], 0, 2) img_indices = data['img_indices'] draw_points_image_labels(img, img_indices, seg_label, color_palette_type='NuScenes', point_size=3) # pseudo_label_2d = data['pseudo_label_2d'] # draw_points_image_labels(img, img_indices, pseudo_label_2d, color_palette_type='NuScenes', point_size=3) draw_bird_eye_view(coords) print('Number of points:', len(coords))