YOLOv7 Inference over PCIe
This project demonstrates how to use the SiMa PePPi API to perform object detection with the YOLOv7 model on a PCIe-connected video stream. It showcases hardware-accelerated inference using SiMa’s MLSoC platform, optimized for integration with PCIe video sources.
Purpose
This pipeline is designed to:
Ingest video input over PCIe from a host or connected capture device.
Run YOLOv7-based object detection on each frame.
Annotate frames with bounding boxes and labels.
Stream the output back to the host or a connected interface (e.g., display, recording module).
This setup targets integration and benchmarking scenarios for PCIe-connected systems.
Configuration Overview
The runtime parameters are defined in project.yaml
. The following tables provide a detailed breakdown of the configuration.
Input Configuration
Parameter |
Description |
Example |
---|---|---|
|
Input type used |
|
|
Identifier string for PCIe input |
|
|
Not used for PCIe setup |
|
|
Not used for PCIe setup |
|
|
Inference pipeline identifier |
|
Model Configuration (Models[0]
)
Parameter |
Description |
Value |
---|---|---|
|
Model identifier |
|
|
Path to the YOLOv7 model archive |
|
|
Path to the label file |
|
|
Enable input normalization |
|
|
Per-channel mean values |
|
|
Per-channel stddev values |
|
|
Padding strategy during preprocessing |
|
|
Preserve input aspect ratio |
|
|
Maximum number of detections per frame |
|
|
Confidence threshold for object detection |
|
|
Postprocessing decode strategy |
|
Main Python Script
The main script performs the following:
Loads the configuration from
project.yaml
.Initializes the PCIe
VideoReader
andVideoWriter
.Sets the expected input and output resolution to 1280×720.
Loads and configures the YOLOv7 model session on SiMa’s MLSoC.
Continuously:
Reads frames from PCIe input
Runs detection inference
Annotates the output frame
Writes the result using PCIe streaming with metadata passthrough
⚠️ Make sure the PCIe input source delivers frames at 1280x720 resolution, or update the script accordingly.
Model Details
Download from here.
Model: YOLOv7
Normalization: Yes (mean:
[0.0, 0.0, 0.0]
, stddev:[1.0, 1.0, 1.0]
)Detection Threshold: 0.7
Output: Top 10 detections per frame
Decoding Strategy: YOLO