Ejemplo n.º 1
0
parser.add_argument(
    '--result_path',
    default=None,
    help='result path for .pickle file from test.py [default: None]')
parser.add_argument('--viz',
                    action='store_true',
                    help='to visualize error result.')
parser.add_argument('--from_rgb_detection',
                    action='store_true',
                    help='test from data file from rgb detection.')
FLAGS = parser.parse_args()

IMG_DIR = '/home/rqi/Data/mysunrgbd/training/image'
TEST_DATASET = roi_seg_box3d_dataset.ROISegBoxDataset(
    npoints=2048,
    split='val',
    rotate_to_center=True,
    overwritten_data_path=FLAGS.data_path,
    from_rgb_detection=FLAGS.from_rgb_detection)
dataset = sunrgbd_object('/home/rqi/Data/mysunrgbd', 'training')
VISU = FLAGS.viz
if VISU:
    import mayavi.mlab as mlab
    from view_pc import draw_lidar, draw_gt_boxes3d

#with open(FLAGS.result_path, 'rb') as fp:
#    ps_list = pickle.load(fp)
#    segp_list = pickle.load(fp)
#    center_list = pickle.load(fp)
#    heading_cls_list = pickle.load(fp)
#    heading_res_list = pickle.load(fp)
#    size_cls_list = pickle.load(fp)
Ejemplo n.º 2
0
LOG_FOUT = open(os.path.join(LOG_DIR, 'log_train.txt'), 'w')
LOG_FOUT.write(str(FLAGS) + '\n')

BN_INIT_DECAY = 0.5
BN_DECAY_DECAY_RATE = 0.5
BN_DECAY_DECAY_STEP = float(DECAY_STEP)
BN_DECAY_CLIP = 0.99

HOSTNAME = socket.gethostname()

NUM_CLASSES = 2

TRAIN_DATASET = roi_seg_box3d_dataset.ROISegBoxDataset(
    npoints=NUM_POINT,
    split='train',
    rotate_to_center=True,
    random_flip=True,
    random_shift=True,
    overwritten_data_path='train_1002_aug5x.zip.pickle',
    one_hot=True)
TEST_DATASET = roi_seg_box3d_dataset.ROISegBoxDataset(
    npoints=NUM_POINT,
    split='val',
    rotate_to_center=True,
    overwritten_data_path='val_1002.zip.pickle',
    one_hot=True)
print(len(TRAIN_DATASET))
print(len(TEST_DATASET))


def log_string(out_str):
    LOG_FOUT.write(out_str + '\n')
Ejemplo n.º 3
0
    classes3D=FLAGS.TRAIN_CLS,
    classes2D=classes2D,
    data3D_keep_prob=FLAGS.train_data3D_keep_prob,
    add3D_for_classes2D_prob=FLAGS.add3D_for_classes2D_prob,
    npoints=NUM_POINT,
    rotate_to_center=True,
    random_flip=aug_data,
    random_shift=aug_data,
    overwritten_data_path=pjoin('frustums', train_file))
print('Length of Train Dataset: (2D: %d, 3D: %d)' % \
    (TRAIN_DATASET.get_len_classes2D(), TRAIN_DATASET.get_len_classes3D()))

TEST_DATASET = roi_seg_box3d_dataset.ROISegBoxDataset(
    FLAGS.TEST_CLS,
    npoints=NUM_POINT,
    split='val',
    rotate_to_center=True,
    overwritten_data_path=pjoin('frustums', test_file),
    one_hot=True)
print('Length of Final Test Dataset : %d' % len(TEST_DATASET))

# For Evaluation
from sunrgbd_data import sunrgbd_object
from test_semisup import main_batch, main_batch_from_rgb_detection
from evaluate import evaluate_predictions, get_ap_info

SUNRGBD_DATASET_DIR = '/home/yewsiang/Transferable3D/dataset/mysunrgbd'
DATASET = sunrgbd_object(SUNRGBD_DATASET_DIR, 'training')


def log_string(out_str):
Ejemplo n.º 4
0
        # Make sure all of the classes specified are valid
        WHITE_LIST = []
        for cls_name in FLAGS.test:
            if not (cls_name in ALL_CLASSES): assert (False)
            WHITE_LIST.append(cls_name)

    MODEL_PATH = FLAGS.model_path
    GPU_INDEX = FLAGS.gpu
    NUM_POINT = FLAGS.num_point
    MODEL = importlib.import_module(FLAGS.model)  # import network module
    NUM_CHANNEL = 3 if FLAGS.no_rgb else 6

    num_classes = len(ALL_CLASSES)
    TEST_DATASET = roi_seg_box3d_dataset.ROISegBoxDataset(WHITE_LIST, npoints=NUM_POINT,
                                                          split='training', rotate_to_center=True, \
                                                          overwritten_data_path=FLAGS.data_path, \
                                                          from_rgb_detection=FLAGS.from_rgb_detection, \
                                                          one_hot=True) # Always take one hot from dataset but may not use it
    print('Test Dataset size: %d' % len(TEST_DATASET))

    # Detections
    print('3D Object Detection...')
    if FLAGS.from_rgb_detection:
        main_batch_from_rgb_detection(
            TEST_DATASET,
            WHITE_LIST,
            num_classes,
            NUM_POINT,
            NUM_CHANNEL,
            prefix=FLAGS.pred_prefix,
            semi_type=FLAGS.semi_type,