Add verbose option to pytorch hub models (#2926)
* Add verbose and update print to logging * Fix positonal param * Revert auto formatting changes * Update hubconf.py Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
1 parent
3665c0f59b
commit
c0d3f80544
3 files changed
+41
-38
No files matched your search
+2
-2
@@ -32,10 +32,10 @@ cv2.setNumThreads(0) # prevent OpenCV from multithreading (incompatible with Py
|
||||
os.environ['NUMEXPR_MAX_THREADS'] = str(min(os.cpu_count(), 8)) # NumExpr max threads
|
||||
|
||||
|
||||
def set_logging(rank=-1):
|
||||
def set_logging(rank=-1, verbose=True):
|
||||
logging.basicConfig(
|
||||
format="%(message)s",
|
||||
level=logging.INFO if rank in [-1, 0] else logging.WARN)
|
||||
level=logging.INFO if (verbose and rank in [-1, 0]) else logging.WARN)
|
||||
|
||||
|
||||
def init_seeds(seed=0):
|
||||
|
||||
Reference in new issue
Block a user