Пример #1
0
def main(_):
    if not os.path.exists(FLAGS.sample_dir):
        os.makedirs(FLAGS.sample_dir)

    # gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.5)
    # run_config = tf.ConfigProto(gpu_options=gpu_options)
    run_config = tf.ConfigProto()
    run_config.gpu_options.allow_growth = True

    if FLAGS.ae:
        with tf.Session(config=run_config) as sess:
            bsp_ae = BSP_AE(
                sess,
                FLAGS.phase,
                FLAGS.sample_vox_size,
                is_training=FLAGS.train or FLAGS.getz,
                dataset_name=FLAGS.dataset,
                checkpoint_dir=FLAGS.checkpoint_dir,
                sample_dir=FLAGS.sample_dir,
                data_dir=FLAGS.data_dir)

            if FLAGS.train:
                bsp_ae.train(FLAGS)
            elif FLAGS.getz:
                bsp_ae.get_z(FLAGS)
            else:
                if FLAGS.phase == 0:
                    bsp_ae.test_dae3(FLAGS)
                else:
                    # bsp_ae.test_bsp(FLAGS)
                    bsp_ae.test_mesh_point(FLAGS)
                    # bsp_ae.test_mesh_obj_material(FLAGS)
    elif FLAGS.svr:
        with tf.Session(config=run_config) as sess:
            bsp_svr = BSP_SVR(
                sess,
                FLAGS.phase,
                FLAGS.sample_vox_size,
                is_training=FLAGS.train,
                dataset_name=FLAGS.dataset,
                checkpoint_dir=FLAGS.checkpoint_dir,
                sample_dir=FLAGS.sample_dir,
                data_dir=FLAGS.data_dir)

            if FLAGS.train:
                bsp_svr.train(FLAGS)
            else:
                # bsp_svr.test_bsp(FLAGS)
                bsp_svr.test_mesh_point(FLAGS)
                # bsp_svr.test_mesh_obj_material(FLAGS)
    else:
        print("Please specify an operation: ae or svr?")
Пример #2
0
if not os.path.exists(FLAGS.sample_dir):
	os.makedirs(FLAGS.sample_dir)

if FLAGS.ae:
	bsp_ae = BSP_AE(FLAGS)
	print("starting in AE")
	if FLAGS.train:
		bsp_ae.train(FLAGS)
	elif FLAGS.getz:
		bsp_ae.get_z(FLAGS)
	else:
		if FLAGS.phase==0:
			bsp_ae.test_dae3(FLAGS)
			# bsp_ae.test_bsp(FLAGS)			
		else:
			# bsp_ae.test_dae3(FLAGS)
			bsp_ae.test_bsp(FLAGS)
			bsp_ae.test_mesh_point(FLAGS)
			# bsp_ae.test_mesh_obj_material(FLAGS)
elif FLAGS.svr:
	bsp_svr = BSP_SVR(FLAGS)

	if FLAGS.train:
		bsp_svr.train(FLAGS)
	else:
		bsp_svr.test_bsp(FLAGS)
		# bsp_svr.test_mesh_point(FLAGS)
		#bsp_svr.test_mesh_obj_material(FLAGS)
else:
	print("Please specify an operation: ae or svr?")
Пример #3
0

if not os.path.exists(FLAGS.sample_dir):
	os.makedirs(FLAGS.sample_dir)

if FLAGS.ae:
	bsp_ae = BSP_AE(FLAGS)

	if FLAGS.train:
		bsp_ae.train(FLAGS)
	elif FLAGS.getz:
		bsp_ae.get_z(FLAGS)
	else:
		if FLAGS.phase==0:
			bsp_ae.test_dae3(FLAGS)
		else:
			#bsp_ae.test_bsp(FLAGS)
			bsp_ae.test_mesh_point(FLAGS)
			#bsp_ae.test_mesh_obj_material(FLAGS)
elif FLAGS.svr:
	bsp_svr = BSP_SVR(FLAGS)

	if FLAGS.train:
		bsp_svr.train(FLAGS)
	else:
		#bsp_svr.test_bsp(FLAGS)
		bsp_svr.test_mesh_point(FLAGS)
		#bsp_svr.test_mesh_obj_material(FLAGS)
else:
	print("Please specify an operation: ae or svr?")