Add Dockerfiles and update Docs README (#124)

Co-authored-by: Ayush Chaurasia <ayush.chaurarsia@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher
2022-12-31 18:39:42 +01:00
committed by GitHub
parent df4fc14c10
commit a9b9fe7618
18 changed files with 608 additions and 167 deletions

View File

@ -2,20 +2,20 @@
"""
Export a YOLOv5 PyTorch model to other formats. TensorFlow exports authored by https://github.com/zldrobit
Format | `format=argument` | Model
--- | --- | ---
PyTorch | - | yolov8n.pt
TorchScript | `torchscript` | yolov8n.torchscript
ONNX | `onnx` | yolov8n.onnx
OpenVINO | `openvino` | yolov8n_openvino_model/
TensorRT | `engine` | yolov8n.engine
CoreML | `coreml` | yolov8n.mlmodel
TensorFlow SavedModel | `saved_model` | yolov8n_saved_model/
TensorFlow GraphDef | `pb` | yolov8n.pb
TensorFlow Lite | `tflite` | yolov8n.tflite
TensorFlow Edge TPU | `edgetpu` | yolov8n_edgetpu.tflite
TensorFlow.js | `tfjs` | yolov8n_web_model/
PaddlePaddle | `paddle` | yolov8n_paddle_model/
Format | `format=argument` | Model
--- | --- | ---
PyTorch | - | yolov8n.pt
TorchScript | `torchscript` | yolov8n.torchscript
ONNX | `onnx` | yolov8n.onnx
OpenVINO | `openvino` | yolov8n_openvino_model/
TensorRT | `engine` | yolov8n.engine
CoreML | `coreml` | yolov8n.mlmodel
TensorFlow SavedModel | `saved_model` | yolov8n_saved_model/
TensorFlow GraphDef | `pb` | yolov8n.pb
TensorFlow Lite | `tflite` | yolov8n.tflite
TensorFlow Edge TPU | `edgetpu` | yolov8n_edgetpu.tflite
TensorFlow.js | `tfjs` | yolov8n_web_model/
PaddlePaddle | `paddle` | yolov8n_paddle_model/
Requirements:
$ pip install -r requirements.txt coremltools onnx onnx-simplifier onnxruntime openvino-dev tensorflow-cpu # CPU
@ -131,7 +131,7 @@ class Exporter:
Initializes the Exporter class.
Args:
cfg (str, optional): Path to a configuration file. Defaults to DEFAULT_CONFIG.
config (str, optional): Path to a configuration file. Defaults to DEFAULT_CONFIG.
overrides (dict, optional): Configuration overrides. Defaults to None.
"""
if overrides is None:

View File

@ -80,7 +80,6 @@ class YOLO:
Args:
weights (str): model checkpoint to be loaded
"""
obj = cls(init_key=cls.__init_key)
obj.ckpt = torch.load(weights, map_location="cpu")
@ -110,7 +109,7 @@ class YOLO:
Logs model info
Args:
verbose (bool): Controls verbosity.
verbose (bool): Controls verbosity.
"""
if not self.model:
LOGGER.info("model not initialized!")
@ -127,8 +126,8 @@ class YOLO:
Visualize prediction.
Args:
source (str): Accepts all source types accepted by yolo
**kwargs : Any other args accepted by the predictors. To see all args check 'configuration' section in the docs
source (str): Accepts all source types accepted by yolo
**kwargs : Any other args accepted by the predictors. To see all args check 'configuration' section in docs
"""
overrides = self.overrides.copy()
overrides.update(kwargs)
@ -145,8 +144,8 @@ class YOLO:
Validate a model on a given dataset
Args:
data (str): The dataset to validate on. Accepts all formats accepted by yolo
kwargs: Any other args accepted by the validators. To see all args check 'configuration' section in the docs
data (str): The dataset to validate on. Accepts all formats accepted by yolo
**kwargs : Any other args accepted by the validators. To see all args check 'configuration' section in docs
"""
if not self.model:
raise ModuleNotFoundError("model not initialized!")
@ -167,8 +166,7 @@ class YOLO:
Export model.
Args:
format (str): Export format
**kwargs : Any other args accepted by the predictors. To see all args check 'configuration' section in the docs
**kwargs : Any other args accepted by the predictors. To see all args check 'configuration' section in docs
"""
overrides = self.overrides.copy()

View File

@ -519,7 +519,7 @@ class BaseTrainer:
decay (float): weight decay
Returns:
torch.optim.Optimizer: the built optimizer
optimizer (torch.optim.Optimizer): the built optimizer
"""
g = [], [], [] # optimizer parameter groups
bn = tuple(v for k, v in nn.__dict__.items() if 'Norm' in k) # normalization layers, i.e. BatchNorm2d()