Install NCNN with '--no-deps' (#21648)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Glenn Jocher 2025-08-11 23:26:55 +02:00 committed by GitHub
parent 03f83bf949
commit 5b55b3cea3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -47,6 +47,7 @@ Inference:
yolo11n.mnn # MNN
yolo11n_ncnn_model # NCNN
yolo11n_imx_model # IMX
yolo11n_rknn_model # RKNN
TensorFlow.js:
$ cd .. && git clone https://github.com/zldrobit/tfjs-yolov5-example.git && cd tfjs-yolov5-example
@ -764,7 +765,7 @@ class Exporter:
@try_export
def export_ncnn(self, prefix=colorstr("NCNN:")):
"""Export YOLO model to NCNN format using PNNX https://github.com/pnnx/pnnx."""
check_requirements("ncnn")
check_requirements("ncnn", cmds="--no-deps") # no deps to avoid installing opencv-python
import ncnn # noqa
LOGGER.info(f"\n{prefix} starting export with NCNN {ncnn.__version__}...")

View File

@ -534,7 +534,7 @@ class AutoBackend(nn.Module):
# NCNN
elif ncnn:
LOGGER.info(f"Loading {w} for NCNN inference...")
check_requirements("git+https://github.com/Tencent/ncnn.git" if ARM64 else "ncnn") # requires NCNN
check_requirements("git+https://github.com/Tencent/ncnn.git" if ARM64 else "ncnn", cmds="--no-deps")
import ncnn as pyncnn
net = pyncnn.Net()