johnk2hawaii commited on
Commit
9708cf5
1 Parent(s): 750c42e

New environment variable `VERBOSE` (#6353)

Browse files
Files changed (1) hide show
  1. utils/general.py +2 -1
utils/general.py CHANGED
@@ -36,6 +36,7 @@ from utils.metrics import box_iou, fitness
36
  FILE = Path(__file__).resolve()
37
  ROOT = FILE.parents[1] # YOLOv5 root directory
38
  NUM_THREADS = min(8, max(1, os.cpu_count() - 1)) # number of YOLOv5 multiprocessing threads
 
39
 
40
  torch.set_printoptions(linewidth=320, precision=5, profile='long')
41
  np.set_printoptions(linewidth=320, formatter={'float_kind': '{:11.5g}'.format}) # format short g, %precision=5
@@ -54,7 +55,7 @@ def is_kaggle():
54
  return False
55
 
56
 
57
- def set_logging(name=None, verbose=True):
58
  # Sets level and returns logger
59
  if is_kaggle():
60
  for h in logging.root.handlers:
 
36
  FILE = Path(__file__).resolve()
37
  ROOT = FILE.parents[1] # YOLOv5 root directory
38
  NUM_THREADS = min(8, max(1, os.cpu_count() - 1)) # number of YOLOv5 multiprocessing threads
39
+ VERBOSE = str(os.getenv('VERBOSE', True)).lower() == 'true' # global verbose mode
40
 
41
  torch.set_printoptions(linewidth=320, precision=5, profile='long')
42
  np.set_printoptions(linewidth=320, formatter={'float_kind': '{:11.5g}'.format}) # format short g, %precision=5
 
55
  return False
56
 
57
 
58
+ def set_logging(name=None, verbose=VERBOSE):
59
  # Sets level and returns logger
60
  if is_kaggle():
61
  for h in logging.root.handlers: