Skip to content

Commit 029181d

Browse files
authored
New environment variable VERBOSE (ultralytics#6353)
New environment variable `VERBOSE`
1 parent 099a07e commit 029181d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

utils/general.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
FILE = Path(__file__).resolve()
3737
ROOT = FILE.parents[1] # YOLOv5 root directory
3838
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
3940

4041
torch.set_printoptions(linewidth=320, precision=5, profile='long')
4142
np.set_printoptions(linewidth=320, formatter={'float_kind': '{:11.5g}'.format}) # format short g, %precision=5
@@ -54,7 +55,7 @@ def is_kaggle():
5455
return False
5556

5657

57-
def set_logging(name=None, verbose=True):
58+
def set_logging(name=None, verbose=VERBOSE):
5859
# Sets level and returns logger
5960
if is_kaggle():
6061
for h in logging.root.handlers:

0 commit comments

Comments
 (0)