Пример #1
0
    use_gt_info = True

    ## others
    num_thread = 20
    gpu_ids = '0'
    num_gpus = 1
    continue_train = False

    def set_args(self, gpu_ids, continue_train=False):
        self.gpu_ids = gpu_ids
        self.num_gpus = len(self.gpu_ids.split(','))
        self.continue_train = continue_train
        os.environ["CUDA_VISIBLE_DEVICES"] = self.gpu_ids
        print('>>> Using GPU: {}'.format(self.gpu_ids))


cfg = Config()

sys.path.insert(0, osp.join(cfg.root_dir, 'common'))
from utils.dir_utils import add_pypath, make_folder
add_pypath(osp.join(cfg.data_dir))
for i in range(len(cfg.trainset_3d)):
    add_pypath(osp.join(cfg.data_dir, cfg.trainset_3d[i]))
for i in range(len(cfg.trainset_2d)):
    add_pypath(osp.join(cfg.data_dir, cfg.trainset_2d[i]))
add_pypath(osp.join(cfg.data_dir, cfg.testset))
make_folder(cfg.model_dir)
make_folder(cfg.vis_dir)
make_folder(cfg.log_dir)
make_folder(cfg.result_dir)
Пример #2
0
                 load_path=None,
                 test=None,
                 params=None):
        self.dataset = dataset
        self.model = model
        self.feats = feats
        self.save_path = save_path
        self.continue_train = continue_train
        self.load_path = load_path
        self.test = test
        self.params = params


#Do not comment "cfg" as it is a global configuration object that will be called later.
cfg = Config()
# sys.path.insert(0, cfg.root_dir)
# sys.path.insert(0, os.path.join(cfg.root_dir, 'data'))
from utils.dir_utils import add_pypath, make_folder

# add_pypath(os.path.join(cfg.data_dir))
# for i in range(len(cfg.datasets)):
#     add_pypath(os.path.join(cfg.data_dir, cfg.datasets[i]))

# Create the folder to store the best trained model
make_folder(cfg.model_dir)
# make_folder(cfg.vis_dir)

# Create the folder to store the log file
make_folder(cfg.log_dir)
# make_folder(cfg.result_dir)