mirror of
				https://github.com/THU-MIG/yolov10.git
				synced 2025-11-04 08:56:11 +08:00 
			
		
		
		
	Filter matplotlib>=3.7.2 tight layout warning (#3614)
				
					
				
			This commit is contained in:
		
							parent
							
								
									10eb0b6229
								
							
						
					
					
						commit
						391b7e67cf
					
				@ -201,7 +201,7 @@ class Exporter:
 | 
				
			|||||||
        if self.args.half and (engine or onnx) and self.device.type != 'cpu':
 | 
					        if self.args.half and (engine or onnx) and self.device.type != 'cpu':
 | 
				
			||||||
            im, model = im.half(), model.half()  # to FP16
 | 
					            im, model = im.half(), model.half()  # to FP16
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Warnings
 | 
					        # Filter warnings
 | 
				
			||||||
        warnings.filterwarnings('ignore', category=torch.jit.TracerWarning)  # suppress TracerWarning
 | 
					        warnings.filterwarnings('ignore', category=torch.jit.TracerWarning)  # suppress TracerWarning
 | 
				
			||||||
        warnings.filterwarnings('ignore', category=UserWarning)  # suppress shape prim::Constant missing ONNX warning
 | 
					        warnings.filterwarnings('ignore', category=UserWarning)  # suppress shape prim::Constant missing ONNX warning
 | 
				
			||||||
        warnings.filterwarnings('ignore', category=DeprecationWarning)  # suppress CoreML np.bool deprecation warning
 | 
					        warnings.filterwarnings('ignore', category=DeprecationWarning)  # suppress CoreML np.bool deprecation warning
 | 
				
			||||||
 | 
				
			|||||||
@ -2,6 +2,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import contextlib
 | 
					import contextlib
 | 
				
			||||||
import math
 | 
					import math
 | 
				
			||||||
 | 
					import warnings
 | 
				
			||||||
from pathlib import Path
 | 
					from pathlib import Path
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import cv2
 | 
					import cv2
 | 
				
			||||||
@ -233,6 +234,9 @@ def plot_labels(boxes, cls, names=(), save_dir=Path(''), on_plot=None):
 | 
				
			|||||||
    import pandas as pd
 | 
					    import pandas as pd
 | 
				
			||||||
    import seaborn as sn
 | 
					    import seaborn as sn
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Filter matplotlib>=3.7.2 warning
 | 
				
			||||||
 | 
					    warnings.filterwarnings('ignore', category=UserWarning, message='The figure layout has changed to tight')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Plot dataset labels
 | 
					    # Plot dataset labels
 | 
				
			||||||
    LOGGER.info(f"Plotting labels to {save_dir / 'labels.jpg'}... ")
 | 
					    LOGGER.info(f"Plotting labels to {save_dir / 'labels.jpg'}... ")
 | 
				
			||||||
    b = boxes.transpose()  # classes, boxes
 | 
					    b = boxes.transpose()  # classes, boxes
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user