from auxiliary.my_utils import * from functools import reduce from auxiliary.model_atlasnet import * import miou_shape import useful_losses as loss import my_utils from my_utils import Max_k, Min_k import ICP import tqdm from save_mesh_from_points_and_labels import * import figure_2_3 import pdb opt = argument_parser.parser() my_utils.plant_seeds(randomized_seed=opt.randomize) min_k = Min_k(opt.k_max_eval) max_k = Max_k(opt.k_max_eval) if opt.num_figure_3_4 > 0: min_k_fig = Min_k(opt.num_figure_3_4) max_k_fig = Max_k(opt.num_figure_3_4) trainer = trainer.Trainer(opt) trainer.build_dataset_train_for_matching() trainer.build_dataset_test_for_matching() trainer.build_network() trainer.network.eval() # =============DEFINE Criterions to evaluate======================================== # NN_latent_space = True crit = [
import sys import auxiliary.argument_parser as argument_parser import auxiliary.my_utils as my_utils import time import torch from auxiliary.my_utils import yellow_print """ Main training script. author : Thibault Groueix 01.11.2019 """ opt = argument_parser.parser() torch.cuda.set_device(opt.multi_gpu[0]) my_utils.plant_seeds(random_seed=opt.random_seed) import training.trainer as trainer trainer = trainer.Trainer(opt) trainer.build_dataset() trainer.build_network() trainer.build_optimizer() trainer.build_losses() trainer.start_train_time = time.time() if opt.demo: with torch.no_grad(): trainer.demo(opt.demo_input_path) sys.exit(0) if opt.run_single_eval: with torch.no_grad(): trainer.test_epoch()