import numpy as np import os import os.path as osp import io import cv2 import time import copy import random import yaml import pdb b=pdb.set_trace from tqdm import tqdm from pqdm.processes import pqdm import logging import argparse # usage of pqdm(args, func, n_jobs) def get_logger(name): logger = logging.getLogger(name) logger.setLevel(logging.INFO) return logger def get_parser(name): parser = argparse.ArgumentParser(description=name) return parser def add_args(parser, name, type=str, default=None, **kwargs): parser.add_argument('--%s' % name, type=type, default=default, **kwargs) return parser def add_flag(parser, name, des=''): parser.add_argument('--%s' % name, action='store_true', help=des) return parser def debug_image(image): cv2.imwrite('test.png', np.uint8(image))