parser.add_argument('--bag_file', type=str, default='train', help='path to a bag containing base and filtered scans.') parser.add_argument('--filtered_topic', type=str, default='/filtered', help='topic to look for filtered scans') parser.add_argument('--base_topic', type=str, default='/Cobot/Laser', help='topic to look for base scans') opt = parser.parse_args() start_time = str(int(time.time())) initialize_logging(start_time) print_output(opt) opt.manualSeed = random.randint(1, 10000) # fix seed print_output("Random Seed: ", opt.manualSeed) random.seed(opt.manualSeed) torch.manual_seed(opt.manualSeed) dataset = LTFDataset(opt.bag_file, opt.base_topic, opt.filtered_topic, 200) ltf_model = SegNet(3, 2) ltf_model.load_state_dict(torch.load(opt.model)) ltf_model.eval() ltf_model = ltf_model.cuda() import matplotlib.pyplot as plt
import torch.utils.data import numpy as np import pickle import time import random from tqdm import tqdm sys.path.append(os.path.join(os.getcwd(), '..')) import helpers from helpers import initialize_logging, print_output from config import Configuration, execution_config, evaluation_config config = Configuration(False, True).parse() start_time = str(int(time.time())) initialize_logging(start_time, 'evaluate_') print_output(config) num_workers = int(execution_config['NUM_WORKERS']) config.manualSeed = random.randint(1, 10000) # fix seed print_output("Random Seed: ", config.manualSeed) random.seed(config.manualSeed) torch.manual_seed(config.manualSeed) scan_conv, scan_match, scan_transform = helpers.create_laser_networks( config.model_dir, config.model_epoch) scan_conv.eval() scan_match.eval() dataset = helpers.load_laser_dataset(config.bag_file, '', 0, config.distance_cache,