from tensorboardX import SummaryWriter from datasets import __datasets__ from models import __models__ from utils import * from torch.utils.data import DataLoader import gc from PIL import Image cudnn.benchmark = True parser = argparse.ArgumentParser(description='seg') parser.add_argument('--mode', type=str, default='test', help='train or test') parser.add_argument('--model', default='seg', help='select a model structure', choices=__models__.keys()) parser.add_argument('--dataset', required=True, help='dataset name', choices=__datasets__.keys()) parser.add_argument('--datapath', default='', help='data path') parser.add_argument('--channels', type=int, default=3, help='net input channels') parser.add_argument('--out_channels', type=int, default=1, help='net output channels') parser.add_argument('--testlist', required=True, help='testing list') parser.add_argument('--test_batch_size',
import torchvision.utils as vutils import torch.nn.functional as F import numpy as np import time from tensorboardX import SummaryWriter from datasets import __datasets__ from models import __models__ from utils import * from torch.utils.data import DataLoader import gc import skimage cudnn.benchmark = True parser = argparse.ArgumentParser(description='Cascade Stereo Network (CasStereoNet)') parser.add_argument('--model', default='gwcnet-c', help='select a model structure', choices=__models__.keys()) parser.add_argument('--maxdisp', type=int, default=192, help='maximum disparity') parser.add_argument('--test_dataset', required=True, help='dataset name', choices=__datasets__.keys()) parser.add_argument('--test_datapath', required=True, help='data path') parser.add_argument('--testlist', required=True, help='testing list') parser.add_argument('--test_batch_size', type=int, default=1, help='testing batch size') parser.add_argument('--logdir', required=True, help='the directory to save logs and checkpoints') parser.add_argument('--loadckpt', help='load the weights from a specific checkpoint') parser.add_argument("--local_rank", type=int, default=0) parser.add_argument('--ndisps', type=str, default="48,24", help='ndisps') parser.add_argument('--disp_inter_r', type=str, default="4,1", help='disp_intervals_ratio')