How detective319/pytorch-yolov4 works
Project type and purpose
• This is an open-source tool/library for object detection: “A minimal PyTorch implementation of YOLOv4” with end-to-end support for training, inference, format conversion (PyTorch→ONNX→TensorRT→TensorFlow), and DeepStream integration.
• Core use cases:
• Train custom YOLOv4 models on datasets (COCO, VOC, user data)
• Run inference with Darknet, PyTorch, ONNX, TensorRT, or DeepStream pipelines
• Convert between model formats via supplied scripts/tools
File structure
• Top-level directories and entry points:
• cfg/ – Darknet-style .cfg files for model architectures
• data/ – Class name lists (coco.names, voc.names)
• tool/ – Conversion and utility modules (darknet2pytorch.py, onnx2tensorflow.py, utils, yolo_layer, iou tests)
• DeepStream/ – NVIDIA DeepStream plugin source & configs
• Key scripts:
• train.py, dataset.py, models.py – training pipeline
• demo*.py – inference and conversion demos
• evaluate_on_coco.py – evaluation
• Third-party/build artifacts:
• DeepStream Makefile and plugin C++/CUDA code
• trtexec calls in README for TensorRT engine builds
README for additional insights
• Describes supported workflows:
• Training (with Mosaic augmentation)
• Inference modes (Darknet, PyTorch, ONNX, TensorRT, DeepStream)
• Conversion scripts and their recommended PyTorch/ONNX/TensorRT versions
• Highlights external dependencies: Darknet weights, PyTorch, ONNX Runtime, TensorRT, DeepStream SDK
Elements
• Labels:
• Data Preparation
• PyTorch Training
• Inference Engines (Darknet, PyTorch, ONNX, TensorRT, DeepStream)
• Conversion Pipelines
• DeepStream Plugin
• Evaluation
• Annotations:
• Version or dependency notes (PyTorch 1.4+, TensorRT 7.x, DeepStream SDK)