Ruff Docstring formatting (#15793)
Signed-off-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
d27664216b
commit
776ca86369
60 changed files with 241 additions and 309 deletions
|
|
@ -146,7 +146,6 @@ def select_device(device="", batch=0, newline=False, verbose=True):
|
|||
Note:
|
||||
Sets the 'CUDA_VISIBLE_DEVICES' environment variable for specifying which GPUs to use.
|
||||
"""
|
||||
|
||||
if isinstance(device, torch.device):
|
||||
return device
|
||||
|
||||
|
|
@ -417,9 +416,7 @@ def initialize_weights(model):
|
|||
|
||||
|
||||
def scale_img(img, ratio=1.0, same_shape=False, gs=32):
|
||||
"""Scales and pads an image tensor of shape img(bs,3,y,x) based on given ratio and grid size gs, optionally
|
||||
retaining the original shape.
|
||||
"""
|
||||
"""Scales and pads an image tensor, optionally maintaining aspect ratio and padding to gs multiple."""
|
||||
if ratio == 1.0:
|
||||
return img
|
||||
h, w = img.shape[2:]
|
||||
|
|
@ -493,7 +490,7 @@ def init_seeds(seed=0, deterministic=False):
|
|||
class ModelEMA:
|
||||
"""
|
||||
Updated Exponential Moving Average (EMA) from https://github.com/rwightman/pytorch-image-models. Keeps a moving
|
||||
average of everything in the model state_dict (parameters and buffers)
|
||||
average of everything in the model state_dict (parameters and buffers).
|
||||
|
||||
For EMA details see https://www.tensorflow.org/api_docs/python/tf/train/ExponentialMovingAverage
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue