YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
188 matches across 12 categories. Click a row to expand file-level details.
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | val.py | 65 | Saves one detection result to a txt file in normalized xywh format, optionally including confidence. Args: |
| HIGH | val.py | 97 | Saves a single JSON detection result, including image ID, category ID, bounding box, and confidence score. Args: |
| HIGH | val.py | 143 | Return a correct prediction matrix given detections and labels at various IoU thresholds. Args: detections |
| HIGH | val.py | 467 | Parse command-line options for configuring YOLOv5 model inference. Args: data (str, optional): Path to the |
| HIGH | val.py | 545 | Executes YOLOv5 tasks like training, validation, testing, speed, and study benchmarks based on provided options. Ar |
| HIGH | export.py | 97 | Initializes an iOS compatible model with normalization based on image dimensions. Args: model (torc |
| HIGH | export.py | 123 | Run a forward pass on the input tensor, returning class confidences and normalized coordinates. Args: |
| HIGH | export.py | 144 | Returns a DataFrame of supported YOLOv5 model export formats and their properties. Returns: pandas.DataFram |
| HIGH | export.py | 183 | Log success or failure, execution time, and file size for YOLOv5 model export functions wrapped with @try_export. A |
| HIGH | export.py | 226 | Export a YOLOv5 model to the TorchScript format. Args: model (torch.nn.Module): The YOLOv5 model to be expo |
| HIGH | export.py | 281 | Export a YOLOv5 model to ONNX format with dynamic axes support and optional model simplification. Args: mod |
| HIGH | export.py | 380 | Export a YOLOv5 model to OpenVINO format with optional FP16 and INT8 quantization. Args: file (Path): Path |
| HIGH | export.py | 468 | Export a YOLOv5 PyTorch model to PaddlePaddle format using X2Paddle, saving the converted model and metadata. Args: |
| HIGH | export.py | 516 | Export a YOLOv5 model to CoreML format with optional NMS, INT8, and FP16 support. Args: model (torch.nn.Mod |
| HIGH | export.py | 587 | Export a YOLOv5 model to TensorRT engine format, requiring GPU and TensorRT>=7.0.0. Args: model (torch.nn.M |
| HIGH | export.py | 707 | Export a YOLOv5 model to the TensorFlow SavedModel format, supporting dynamic axes and non-maximum suppression (NMS) |
| HIGH | export.py | 790 | Export YOLOv5 model to TensorFlow GraphDef (*.pb) format. Args: keras_model (tf.keras.Model): The Keras mod |
| HIGH | export.py | 830 | Export a YOLOv5 model to TensorFlow Lite format with optional INT8 quantization and NMS support. Args: kera |
| HIGH | export.py | 903 | Exports a YOLOv5 model to Edge TPU compatible TFLite format; requires Linux and Edge TPU compiler. Args: fi |
| HIGH | export.py | 964 | Convert a YOLOv5 model to TensorFlow.js format with optional uint8 quantization. Args: file (Path): Path to |
| HIGH | export.py | 1025 | Adds metadata to a TensorFlow Lite (TFLite) model file, supporting multiple outputs according to TensorFlow guidelin |
| HIGH | export.py | 1086 | Convert a PyTorch YOLOv5 model to CoreML format with Non-Maximum Suppression (NMS), handling different input/output |
| HIGH | export.py | 1285 | Exports a YOLOv5 model to specified formats including ONNX, TensorRT, CoreML, and TensorFlow. Args: data (s |
| HIGH | export.py | 1465 | Parse command-line options for YOLOv5 model export configurations. Args: known (bool): If True, uses `argpa |
| HIGH | train.py | 106 | Train a YOLOv5 model on a custom dataset using specified hyperparameters, options, and device, managing datasets, mo |
| HIGH | train.py | 547 | Parse command-line arguments for YOLOv5 training, validation, and testing. Args: known (bool, optional): If |
| HIGH | train.py | 621 | Runs the main entry point for training or hyperparameter evolution with specified options and optional callbacks. A |
| HIGH | train.py | 890 | Generate an individual with random hyperparameters within specified ranges. Args: input_ranges (list[tuple[ |
| HIGH | train.py | 920 | Execute YOLOv5 training with specified options, allowing optional overrides through keyword arguments. Args: |
| HIGH | hubconf.py | 17 | Creates or loads a YOLOv5 model, with options for pretrained weights and model customization. Args: name (s |
| HIGH | hubconf.py | 108 | Loads a custom or local YOLOv5 model from a given path with optional autoshaping and device specification. Args: |
| HIGH | hubconf.py | 139 | Instantiates the YOLOv5-nano model with options for pretraining, input channels, class count, autoshaping, verbosity |
| HIGH | hubconf.py | 176 | Create a YOLOv5-small (yolov5s) model with options for pretraining, input channels, class count, autoshaping, verbos |
| HIGH | hubconf.py | 217 | Instantiates the YOLOv5-medium model with customizable pretraining, channel count, class count, autoshaping, verbosi |
| HIGH | hubconf.py | 250 | Creates YOLOv5-large model with options for pretraining, channels, classes, autoshaping, verbosity, and device selec |
| HIGH | hubconf.py | 280 | Perform object detection using the YOLOv5-xlarge model with options for pretraining, input channels, class count, au |
| HIGH | hubconf.py | 310 | Creates YOLOv5-nano-P6 model with options for pretraining, channels, classes, autoshaping, verbosity, and device. A |
| HIGH | hubconf.py | 337 | Instantiate the YOLOv5-small-P6 model with options for pretraining, input channels, number of classes, autoshaping, |
| HIGH | hubconf.py | 374 | Create YOLOv5-medium-P6 model with options for pretraining, channel count, class count, autoshaping, verbosity, and |
| HIGH | hubconf.py | 408 | Instantiate the YOLOv5-large-P6 model with options for pretraining, channel and class counts, autoshaping, verbosity |
| HIGH | hubconf.py | 440 | Creates the YOLOv5-xlarge-P6 model with options for pretraining, number of input channels, class count, autoshaping, |
| HIGH | detect.py | 102 | Runs YOLOv5 detection inference on various sources like images, videos, directories, streams, etc. Args: we |
| HIGH | detect.py | 332 | Parse command-line arguments for YOLOv5 detection, allowing custom inference options and model configurations. Args |
| HIGH | detect.py | 417 | Executes YOLOv5 model inference based on provided command-line arguments, validating dependencies before running. A |
| HIGH | benchmarks.py | 63 | Run YOLOv5 benchmarks on multiple export formats and log results for model performance evaluation. Args: we |
| HIGH | benchmarks.py | 159 | Run YOLOv5 export tests for all supported formats and log the results, including export statuses. Args: wei |
| HIGH | benchmarks.py | 218 | Parses command-line arguments for YOLOv5 model inference configuration. Args: weights (str): The path to th |
| HIGH | benchmarks.py | 256 | Executes YOLOv5 benchmark tests or main training/inference routines based on the provided command-line arguments. A |
| HIGH | utils/metrics.py | 304 | Returns the intersection over box2 area given box1, box2. Args: box1: np.array of shape(4) box2: np |
| HIGH | utils/autoanchor.py | 67 | Creates kmeans-evolved anchors from training dataset. Args: dataset: path to data.yaml, or a loaded dataset |
| HIGH | utils/segment/general.py | 121 | Args: mask1: [N, n] m1 means number of predicted objects mask2: [M, n] m2 means number of gt object |
| HIGH | utils/segment/general.py | 138 | Args: mask1: [N, n] m1 means number of predicted objects mask2: [N, n] m2 means number of gt object |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | val.py | 452 | except Exception as e: |
| LOW | export.py | 217 | except Exception as e: |
| LOW | export.py | 373 | except Exception as e: |
| LOW | export.py | 624 | except Exception: |
| LOW | export.py | 743 | except Exception: |
| LOW | hubconf.py | 85 | except Exception: |
| LOW | hubconf.py | 101 | except Exception as e: |
| LOW | benchmarks.py | 127 | except Exception as e: |
| LOW | benchmarks.py | 204 | except Exception: |
| LOW | segment/val.py | 435 | except Exception as e: |
| LOW | utils/autobatch.py | 53 | except Exception as e: |
| LOW | utils/dataloaders.py | 585 | except Exception as e: |
| LOW | utils/dataloaders.py | 595 | except Exception: |
| LOW | utils/dataloaders.py | 752 | except Exception as e: |
| LOW | utils/dataloaders.py | 1171 | except Exception as e: |
| LOW | utils/dataloaders.py | 1202 | except Exception as e: |
| LOW | utils/dataloaders.py | 1244 | except Exception as e: # use OpenCV |
| LOW | utils/downloads.py | 72 | except Exception as e: # url2 |
| LOW | utils/downloads.py | 114 | except Exception: |
| LOW | utils/downloads.py | 117 | except Exception: |
| LOW | utils/downloads.py | 120 | except Exception: |
| LOW | utils/plots.py | 453 | except Exception as e: |
| LOW | utils/plots.py | 488 | except Exception as e: |
| LOW | utils/autoanchor.py | 141 | except Exception: |
| LOW | utils/torch_utils.py | 108 | except Exception: |
| LOW | utils/torch_utils.py | 182 | except Exception: |
| LOW | utils/torch_utils.py | 193 | except Exception: # no backward method |
| LOW | utils/torch_utils.py | 203 | except Exception as e: |
| LOW | utils/torch_utils.py | 316 | except Exception: |
| LOW | utils/torch_utils.py | 390 | except Exception: |
| LOW | utils/general.py | 367 | except Exception: |
| LOW | utils/general.py | 459 | except Exception as e: |
| LOW | utils/general.py | 608 | except Exception: |
| LOW | utils/general.py | 1274 | except Exception: |
| LOW | utils/augmentations.py | 47 | except Exception as e: |
| LOW | utils/augmentations.py | 354 | except Exception as e: |
| LOW | utils/loggers/__init__.py | 134 | except Exception: |
| LOW | utils/loggers/__init__.py | 384 | except Exception: |
| LOW | utils/loggers/__init__.py | 465 | except Exception as e: |
| LOW | utils/loggers/comet/comet_utils.py | 64 | except Exception as e: |
| LOW | utils/segment/plots.py | 145 | except Exception as e: |
| LOW | utils/flask_rest_api/restapi.py | 51 | except Exception: |
| LOW | models/yolo.py | 492 | except Exception as e: |
| MEDIUM | models/yolo.py | 493 | print(f"Error in {cfg}: {e}") |
| LOW | .github/workflows/merge-main-into-prs.yml | 66 | except Exception as update_error: |
| LOW | .github/workflows/merge-main-into-prs.yml | 71 | except Exception as e: |
| LOW | data/Objects365.yaml | 436 | except Exception as e: |
| LOW | data/xView.yaml | 131 | except Exception as e: |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | val.py | 184 | |
| LOW | val.py | 544 | |
| LOW | train.py | 105 | |
| LOW | train.py | 620 | |
| LOW | hubconf.py | 16 | |
| LOW | detect.py | 71 | |
| LOW | classify/val.py | 53 | |
| LOW | classify/predict.py | 68 | |
| LOW | classify/train.py | 78 | |
| LOW | segment/val.py | 155 | |
| LOW | segment/val.py | 482 | |
| LOW | segment/predict.py | 70 | |
| LOW | segment/train.py | 100 | |
| LOW | segment/train.py | 592 | |
| LOW | utils/metrics.py | 238 | |
| LOW | utils/dataloaders.py | 1061 | |
| LOW | utils/dataloaders.py | 1126 | |
| LOW | utils/dataloaders.py | 321 | |
| LOW | utils/dataloaders.py | 537 | |
| LOW | utils/dataloaders.py | 872 | |
| LOW | utils/dataloaders.py | 932 | |
| LOW | utils/downloads.py | 86 | |
| LOW | utils/plots.py | 152 | |
| LOW | utils/plots.py | 460 | |
| LOW | utils/torch_utils.py | 67 | |
| LOW | utils/torch_utils.py | 156 | |
| LOW | utils/torch_utils.py | 220 | |
| LOW | utils/torch_utils.py | 346 | |
| LOW | utils/general.py | 481 | |
| LOW | utils/general.py | 521 | |
| LOW | utils/general.py | 651 | |
| LOW | utils/general.py | 654 | |
| LOW | utils/augmentations.py | 313 | |
| LOW | utils/segment/dataloaders.py | 237 | |
| LOW | utils/segment/loss.py | 47 | |
| LOW | utils/segment/plots.py | 19 | |
| LOW | utils/segment/plots.py | 115 | |
| LOW | utils/segment/general.py | 154 | |
| LOW | models/tf.py | 507 | |
| LOW | models/common.py | 457 | |
| LOW | models/common.py | 687 | |
| LOW | models/common.py | 852 | |
| LOW | models/common.py | 943 | |
| LOW | models/yolo.py | 378 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | val.py | 405 | # Print results |
| LOW | val.py | 411 | # Print results per class |
| LOW | detect.py | 256 | # Print results |
| LOW | detect.py | 321 | # Print results |
| LOW | benchmarks.py | 135 | # Print results |
| LOW | benchmarks.py | 207 | # Print results |
| LOW | classify/val.py | 141 | # Print results |
| LOW | classify/predict.py | 153 | # Print results |
| LOW | classify/predict.py | 197 | # Print results |
| LOW | segment/val.py | 387 | # Print results |
| LOW | segment/val.py | 393 | # Print results per class |
| LOW | segment/predict.py | 186 | # Print results |
| LOW | segment/predict.py | 250 | # Print results |
| LOW | utils/loggers/comet/__init__.py | 163 | # Check if running the Experiment with the Comet Optimizer |
| LOW | utils/loggers/comet/__init__.py | 463 | # Check if running Experiment with Comet Optimizer |
| LOW | utils/loggers/clearml/clearml_utils.py | 123 | # Set data to data_dict because wandb will crash without this information and opt is the best way |
| LOW | .github/workflows/merge-main-into-prs.yml | 55 | # Check if PR is behind the default branch |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/test_flask_rest_api.py | 56 | def test_rejects_non_image_upload_with_allowed_extension(client): |
| LOW | tests/test_flask_rest_api.py | 62 | def test_rejects_upload_with_disallowed_extension(client): |
| LOW | tests/test_flask_rest_api.py | 68 | def test_rejects_oversized_upload(client): |
| LOW | tests/test_flask_rest_api.py | 74 | def test_accepts_valid_image_upload(client): |
| LOW | utils/triton.py | 29 | def create_input_placeholders() -> list[InferInput]: |
| LOW | utils/triton.py | 42 | def create_input_placeholders() -> list[InferInput]: |
| LOW | utils/dataloaders.py | 1343 | def create_classification_dataloader( |
| LOW | utils/torch_utils.py | 67 | def reshape_classifier_output(model, n=1000): |
| LOW | utils/torch_utils.py | 91 | def torch_distributed_zero_first(local_rank: int): |
| LOW | utils/loggers/__init__.py | 175 | def on_pretrain_routine_start(self): |
| LOW | utils/loggers/comet/__init__.py | 370 | def download_dataset_artifact(self, artifact_path): |
| LOW | utils/loggers/comet/comet_utils.py | 21 | def download_model_checkpoint(opt, experiment): |
| LOW | utils/segment/metrics.py | 15 | def ap_per_class_box_and_mask( |
| LOW | models/tf.py | 716 | def representative_dataset_gen(dataset, ncalib=100): |
| Severity | File | Line | Snippet |
|---|---|---|---|
| CRITICAL | export.py | 1236 | pipeline.spec.description.metadata.userDefined.update( |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | train.py | 851 | # Create the next generation through crossover and mutation |
| MEDIUM | detect.py | 222 | # Define the path for the CSV file |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | requirements.txt | 21 | # Logging --------------------------------------------------------------------- |
| LOW | requirements.txt | 41 | # Deploy ---------------------------------------------------------------------- |
| LOW | pyproject.toml | 1 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license |
| LOW | utils/autoanchor.py | 141 | except Exception: |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | pyproject.toml | 19 | # For comprehensive documentation and usage instructions, visit: https://docs.ultralytics.com |
| MEDIUM | models/common.py | 813 | """AutoShape class for robust YOLOv5 inference with preprocessing, NMS, and support for various input formats.""" |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | utils/triton.py | 4 | |
| LOW | utils/general.py | 4 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | utils/autobatch.py | 21 | # Usage: |
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | export.py | 41 | $ cd .. && git clone https://github.com/zldrobit/tfjs-yolov5-example.git && cd tfjs-yolov5-example |