Instructions to use hdwing/insulator-defect-detection-rtdetr-r18 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use hdwing/insulator-defect-detection-rtdetr-r18 with ultralytics:
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("hdwing/insulator-defect-detection-rtdetr-r18", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
RT-DETR-R18 绝缘子缺陷检测模型
中文介绍
本仓库提供一个面向输电线路巡检和工业视觉场景的 RT-DETR-R18 绝缘子缺陷检测模型。模型基于 Ultralytics RT-DETR 架构训练,可用于绝缘子图像中的目标检测和缺陷识别。
模型发布包包含训练得到的 PyTorch 权重、RT-DETR-R18 模型配置、四分类配置、类别映射、推理脚本、依赖文件和安全说明。完整的 Windows 桌面应用还提供单张图片检测、文件夹批量检测、样本标注、数据集管理和检测结果导出功能。
完整应用源码和桌面端使用工具请访问:
模型信息
- 模型架构:RT-DETR-R18
- 权重文件:
RT-DETER-R18.pt - 类别数量:4
- 输入尺寸:640
- 记录训练轮数:300
- 记录批大小:16
- 记录置信度阈值:0.25–0.50,实际使用时可自行调整
- 权重 SHA-256:
652A16DCA433AC219E59D7FADC1C1E0AFE08B45BBE462900CA6EF9ABCB284732
类别映射如下:
| 类别编号 | 英文标签 | 中文含义 |
|---|---|---|
| 0 | explosion |
自爆 |
| 1 | breakage |
破损 |
| 2 | flashover |
闪络 |
| 3 | insulator |
绝缘子 |
文件说明
RT-DETER-R18.pt:训练好的模型权重。model_config/rtdetr-r18.yaml:RT-DETR-R18 原始模型配置。model_config/rtdetr-r18-insulator.yaml:适配四分类绝缘子检测的模型配置。labels.json:机器可读的类别映射。model_metadata.json:模型结构、权重大小和校验值等元数据。scripts/infer.py:图片、文件夹或视频推理入口。requirements.txt:模型推理所需的 Python 依赖。SECURITY.md:模型文件安全使用说明。LICENSE-NOTICE.txt:代码和模型权重许可说明。
安装
建议使用 Python 3.10 或 3.11,并创建独立虚拟环境:
python -m venv .venv
# Linux/macOS
source .venv/bin/activate
# Windows PowerShell
.venv\\Scripts\\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
PyTorch 应根据操作系统、显卡驱动和 CUDA 版本选择合适的安装方式。CPU 用户可以直接安装 CPU 版本;NVIDIA GPU 用户应先按照 PyTorch 官方安装矩阵安装匹配的 GPU 版本。
推理示例
使用单张图片或目录进行推理:
python scripts/infer.py \
--weights RT-DETER-R18.pt \
--source path/to/image-or-directory \
--device cpu \
--conf 0.25
使用 NVIDIA GPU 时,可以将设备参数改为:
python scripts/infer.py \
--weights RT-DETER-R18.pt \
--source path/to/image-or-directory \
--device 0 \
--conf 0.25
如果需要使用完整桌面程序,请从 PowerInsulatorAI GitHub 项目 获取应用源码、定制的 Ultralytics 代码和安装说明。
训练数据和限制
本仓库不包含训练数据集,也没有提供完整的训练过程、评测指标或泛化能力证明。因此,不应根据模型结构或训练参数推断模型准确率。正式部署前,请使用具有代表性的现场数据验证准确率、误检率、漏检率和推理速度。
模型权重的单独许可条件未在现有项目文件中明确说明。代码许可证不自动决定模型权重的再分发权限,使用或再分发前请向权利人确认授权情况。
安全提示
.pt 文件使用 PyTorch pickle 序列化格式。加载不可信的模型文件可能导致任意代码执行,请只加载来自可信来源的权重文件。
RT-DETR-R18 Insulator Defect Detection Model
English Overview
This repository provides an RT-DETR-R18 object-detection model for insulator inspection in power-transmission and industrial computer-vision scenarios. The model is based on the Ultralytics RT-DETR architecture and is intended to detect insulators and common insulator-related defects in images.
The release package includes the PyTorch checkpoint, RT-DETR-R18 model configurations, a four-class configuration, label metadata, an inference script, dependency information, and security notes. The complete Windows application additionally provides single-image detection, batch folder inference, sample annotation, dataset management, and detection-result export.
For the complete desktop application and source code, visit:
Model Details
- Architecture: RT-DETR-R18
- Checkpoint:
RT-DETER-R18.pt - Number of classes: 4
- Input size recorded in the project: 640 pixels
- Recorded training epochs: 300
- Recorded batch size: 16
- Typical confidence threshold: 0.25–0.50, adjustable for the target application
- Checkpoint SHA-256:
652A16DCA433AC219E59D7FADC1C1E0AFE08B45BBE462900CA6EF9ABCB284732
The class mapping is:
| Class ID | Label | Chinese meaning |
|---|---|---|
| 0 | explosion |
自爆 |
| 1 | breakage |
破损 |
| 2 | flashover |
闪络 |
| 3 | insulator |
绝缘子 |
Repository Contents
RT-DETER-R18.pt: trained PyTorch checkpoint.model_config/rtdetr-r18.yaml: original RT-DETR-R18 model configuration.model_config/rtdetr-r18-insulator.yaml: four-class insulator-detection configuration.labels.json: machine-readable class mapping.model_metadata.json: checkpoint and model metadata.scripts/infer.py: inference entry point for images, directories, or videos.requirements.txt: Python dependencies used by the model code.SECURITY.md: security guidance for loading model files.LICENSE-NOTICE.txt: licensing and redistribution notice.
Installation
Python 3.10 or 3.11 is recommended. Create an isolated virtual environment and install the dependencies:
python -m venv .venv
# Linux/macOS
source .venv/bin/activate
# Windows PowerShell
.venv\\Scripts\\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
Install a PyTorch build that matches your operating system, hardware, NVIDIA driver, and CUDA version. CPU users can install a CPU build. GPU users should follow the official PyTorch installation selector for a compatible CUDA build.
Inference
Run inference on a single image or a directory:
python scripts/infer.py \
--weights RT-DETER-R18.pt \
--source path/to/image-or-directory \
--device cpu \
--conf 0.25
For NVIDIA GPU inference, use a device index such as 0 after installing a compatible GPU build of PyTorch:
python scripts/infer.py \
--weights RT-DETER-R18.pt \
--source path/to/image-or-directory \
--device 0 \
--conf 0.25
For the full desktop workflow, application source, customized Ultralytics code, and Windows installation instructions, see the PowerInsulatorAI GitHub repository.
Data, Evaluation, and Limitations
The training dataset is not included. The supplied project does not provide a complete training log, verified evaluation metrics, or a formal generalization study. Do not infer accuracy from the architecture or recorded training parameters. Before deployment, validate precision, false-positive rate, false-negative rate, and inference speed on representative field data.
The separate license for the checkpoint is not specified in the supplied project files. The license of the source code does not automatically determine the redistribution rights of the checkpoint. Confirm the checkpoint terms with the rights holder before using or redistributing it.
Security Notice
PyTorch .pt files use pickle-based serialization. Loading an untrusted checkpoint may execute arbitrary code. Only load model files from trusted sources.
- Downloads last month
- 101