智慧巡检-无人机高空红外检测系统pyqt5界面pyqt5可视化界面数据集无人机高空红外数据集】 2866张 5类names:0: Person1: Car2: Bicycle3: OtherVehicle4: DontCare共2866张train2008张val287张test571张标注文件为YOLO适用的txt格式或xml格式。可以直接用于模型训练。该数据集包含从43470帧中提取的2898幅红外热图像这些图像由无人机从不同场景学校、停车场、道路、操场等捕捉到涵盖范围广泛包括物体人、自行车、汽车、其他车辆、飞行高度数据60至130米、相机透视数据30至90度和日光强度白天和晚上系统软件PycharmAnaconda环境python3.9 opencv PyQt5 torch1.9文件更换系统背景图说明 环境文件 UI文件 数据集yaml种类文件 模型训练文件 环境配置文档 测试图片、视频 训练脚本代码 测试代码 界面代码功能基于深度学习的行人与车辆识别检测系统 pygt界面可检测图像、视频以及保存检测结果可显示目标位置、置信度、检测时间目标数目。检测图片、视频等图像中的各目标数目摄像头监控实时检测便携展示、记录和保存支持切换目标各目标位置切换查看提供数据集和训练代码可重新训练。无人机高空红外目标检测系统完整项目含数据集训练PyQt5界面一、项目核心信息表项目详情项目名称无人机高空红外行人车辆检测系统数据集规模2866张红外图像train:2008/val:287/test:571检测类别5类Person(人)、Car(汽车)、Bicycle(自行车)、OtherVehicle(其他车辆)、DontCare(忽略区域)标注格式YOLO TXT 格式兼容XML采集场景学校、停车场、道路、操场等覆盖不同高度(60-130m)、角度(30-90°)、昼夜场景开发环境Python 3.9 PyTorch 1.9 PyQt5 OpenCV Ultralytics YOLOv8交付内容完整UI界面源码 训练/测试代码 数据集yaml配置 运行教程核心功能图片/视频/摄像头检测、结果保存、目标信息可视化、数据集训练二、项目文件结构drone_infrared_detection/ ├── datasets/ # 无人机红外数据集 │ ├── images/ │ │ ├── train/ │ │ ├── val/ │ │ └── test/ │ ├── labels/ # YOLO格式标注 │ │ ├── train/ │ │ ├── val/ │ │ └── test/ │ └── drone.yaml # 数据集配置文件 ├── models/ # 训练好的权重best.pt ├── runs/ # 训练日志与结果 ├── save_data/ # 检测结果保存目录 ├── TestFiles/ # 测试图片/视频 ├── UIProgram/ # PyQt5界面文件.ui/.qrc/背景图 ├── app_settings.json # 界面配置文件 ├── CameraTest.py # 摄像头测试脚本 ├── Config.py # 类别配置脚本 ├── detect_tools.py # 核心检测工具 ├── imgTest.py # 图片测试脚本 ├── installPackages.py # 环境安装脚本 ├── MainProgram.py # PyQt5主界面入口 ├── requirements.txt # 依赖列表 ├── train.py # 模型训练脚本 └── VideoTest.py # 视频测试脚本三、环境配置# 创建虚拟环境conda create-ndrone_infraredpython3.9conda activate drone_infrared# 安装依赖pipinstalltorch1.9.0torchvision0.10.0torchaudio0.10.0 pipinstallultralytics opencv-python pyqt5 numpy pillow四、数据集配置文件drone.yamltrain:./datasets/images/trainval:./datasets/images/valtest:./datasets/images/testnc:5names:0:Person1:Car2:Bicycle3:OtherVehicle4:DontCare五、模型训练代码train.pyfromultralyticsimportYOLOdefmain():# 加载YOLOv8预训练模型modelYOLO(yolov8n.pt)# 训练参数配置model.train(data./datasets/drone.yaml,epochs100,imgsz640,batch16,device0,# CPU训练改为 devicecpuworkers4,patience15,projectdrone_result,nameyolov8_drone,saveTrue,save_period10)# 模型评估metricsmodel.val()print(训练完成模型评估指标,metrics)if__name____main__:main()六、核心检测工具detect_tools.pyfromultralyticsimportYOLOimportcv2importnumpyasnpclassDroneInfraredDetector:def__init__(self,model_path,conf0.25,iou0.45):self.modelYOLO(model_path)self.confconf self.iouiou self.classesself.model.namesdefdetect_image(self,img_path):resultsself.model.predict(sourceimg_path,confself.conf,iouself.iou,saveFalse)result_imgresults[0].plot()boxes_info[]forboxinresults[0].boxes:cls_idint(box.cls)cls_nameself.classes[cls_id]conffloat(box.conf)xmin,ymin,xmax,ymaxmap(int,box.xyxy[0])boxes_info.append({类别:cls_name,置信度:round(conf*100,2),坐标:[xmin,ymin,xmax,ymax]})returnresult_img,boxes_infodefdetect_video(self,video_path,save_pathNone):capcv2.VideoCapture(video_path)fpsint(cap.get(cv2.CAP_PROP_FPS))w,hint(cap.get(3)),int(cap.get(4))writercv2.VideoWriter(save_path,cv2.VideoWriter_fourcc(*mp4v),fps,(w,h))ifsave_pathelseNonewhilecap.isOpened():ret,framecap.read()ifnotret:breakresultsself.model(frame,confself.conf,iouself.iou)frameresults[0].plot()ifwriter:writer.write(frame)cv2.imshow(无人机红外检测,frame)ifcv2.waitKey(1)0xFFord(q):breakcap.release()ifwriter:writer.release()cv2.destroyAllWindows()七、PyQt5主界面MainProgram.pyimportsysimportcv2importnumpyasnpfromPyQt5.QtWidgetsimport(QApplication,QMainWindow,QWidget,QVBoxLayout,QHBoxLayout,QPushButton,QLabel,QFileDialog,QDoubleSpinBox,QTableWidget,QTableWidgetItem,QHeaderView,QComboBox)fromPyQt5.QtGuiimportQPixmap,QImagefromPyQt5.QtCoreimportQt,QThread,pyqtSignalfromdetect_toolsimportDroneInfraredDetectorclassDetectThread(QThread):result_signalpyqtSignal(np.ndarray,list)def__init__(self,detector,img_path):super().__init__()self.detectordetector self.img_pathimg_pathdefrun(self):result_img,boxes_infoself.detector.detect_image(self.img_path)self.result_signal.emit(result_img,boxes_info)classDroneInfraredUI(QMainWindow):def__init__(self):super().__init__()self.setWindowTitle(无人机高空红外目标检测系统)self.setGeometry(100,100,1300,800)self.detectorNoneself.initUI()definitUI(self):central_widgetQWidget()self.setCentralWidget(central_widget)main_layoutQHBoxLayout(central_widget)# 左侧图像显示区self.img_labelQLabel(请选择红外图片/视频进行检测)self.img_label.setAlignment(Qt.AlignCenter)self.img_label.setStyleSheet(border:1px solid #ccc;)main_layout.addWidget(self.img_label,2)# 右侧控制面板right_widgetQWidget()right_layoutQVBoxLayout(right_widget)# 参数设置param_groupQWidget()param_layoutQVBoxLayout(param_group)self.model_btnQPushButton(选择模型)self.model_btn.clicked.connect(self.select_model)param_layout.addWidget(self.model_btn)# 置信度、IOU调节conf_layoutQHBoxLayout()conf_layout.addWidget(QLabel(置信度阈值:))self.conf_spinQDoubleSpinBox()self.conf_spin.setRange(0,1)self.conf_spin.setValue(0.25)conf_layout.addWidget(self.conf_spin)param_layout.addLayout(conf_layout)iou_layoutQHBoxLayout()iou_layout.addWidget(QLabel(交并比阈值:))self.iou_spinQDoubleSpinBox()self.iou_spin.setRange(0,1)self.iou_spin.setValue(0.45)iou_layout.addWidget(self.iou_spin)param_layout.addLayout(iou_layout)# 设备选择device_layoutQHBoxLayout()device_layout.addWidget(QLabel(检测设备:))self.device_comboQComboBox()self.device_combo.addItems([CPU,GPU])device_layout.addWidget(self.device_combo)param_layout.addLayout(device_layout)right_layout.addWidget(param_group)# 检测结果区result_groupQWidget()result_layoutQVBoxLayout(result_group)self.time_labelQLabel(用时0.000s)self.count_labelQLabel(目标数目0)self.conf_labelQLabel(置信度0.00%)self.pos_labelQLabel(目标位置\nxmin: 0 ymin: 0\nxmax: 0 ymax: 0)result_layout.addWidget(self.time_label)result_layout.addWidget(self.count_label)result_layout.addWidget(self.conf_label)result_layout.addWidget(self.pos_label)right_layout.addWidget(result_group)# 操作按钮btn_layoutQHBoxLayout()self.open_img_btnQPushButton(打开图片)self.open_img_btn.clicked.connect(self.open_image)self.open_folder_btnQPushButton(打开文件夹)self.open_video_btnQPushButton(打开视频)self.open_cam_btnQPushButton(打开摄像头)self.save_btnQPushButton(保存)self.exit_btnQPushButton(退出)btn_layout.addWidget(self.open_img_btn)btn_layout.addWidget(self.open_folder_btn)btn_layout.addWidget(self.open_video_btn)btn_layout.addWidget(self.open_cam_btn)btn_layout.addWidget(self.save_btn)btn_layout.addWidget(self.exit_btn)right_layout.addLayout(btn_layout)# 结果表格self.result_tableQTableWidget()self.result_table.setColumnCount(5)self.result_table.setHorizontalHeaderLabels([序号,文件路径,类别,置信度,坐标位置])self.result_table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)right_layout.addWidget(self.result_table)main_layout.addWidget(right_widget,1)defselect_model(self):path,_QFileDialog.getOpenFileName(self,选择模型,,*.pt)ifpath:self.detectorDroneInfraredDetector(path,self.conf_spin.value(),self.iou_spin.value())defopen_image(self):path,_QFileDialog.getOpenFileName(self,选择红外图片,,*.jpg;*.png;*.jpeg)ifpath:ifnotself.detector:self.detectorDroneInfraredDetector(drone_result/yolov8_drone/weights/best.pt)self.threadDetectThread(self.detector,path)self.thread.result_signal.connect(self.update_result)self.thread.start()defupdate_result(self,img,boxes_info):# 更新图像显示img_rgbcv2.cvtColor(img,cv2.COLOR_BGR2RGB)h,w,cimg_rgb.shape bytes_per_linec*w qimgQImage(img_rgb.data,w,h,bytes_per_line,QImage.Format_RGB888)self.img_label.setPixmap(QPixmap.fromImage(qimg).scaled(self.img_label.size(),Qt.KeepAspectRatio))# 更新结果信息self.count_label.setText(f目标数目{len(boxes_info)})ifboxes_info:self.conf_label.setText(f置信度{boxes_info[0][置信度]}%)self.pos_label.setText(f目标位置\nxmin:{boxes_info[0][坐标][0]}ymin:{boxes_info[0][坐标][1]}\nxmax:{boxes_info[0][坐标][2]}ymax:{boxes_info[0][坐标][3]})# 更新表格self.result_table.setRowCount(len(boxes_info))fori,infoinenumerate(boxes_info):self.result_table.setItem(i,0,QTableWidgetItem(str(i1)))self.result_table.setItem(i,1,QTableWidgetItem(...))self.result_table.setItem(i,2,QTableWidgetItem(info[类别]))self.result_table.setItem(i,3,QTableWidgetItem(f{info[置信度]}%))self.result_table.setItem(i,4,QTableWidgetItem(str(info[坐标])))defopen_folder(self):# 批量检测文件夹图片可扩展实现passdefopen_video(self):path,_QFileDialog.getOpenFileName(self,选择视频,,*.mp4;*.avi)ifpathandself.detector:self.detector.detect_video(path)defopen_camera(self):ifself.detector:self.detector.detect_video(0)if__name____main__:appQApplication(sys.argv)windowDroneInfraredUI()window.show()sys.exit(app.exec_())八、系统功能清单✅多源检测图片、视频、本地摄像头实时检测✅参数可调置信度、IOU阈值自由设置支持CPU/GPU设备切换✅目标可视化界面实时显示目标位置、类别、置信度、总数、检测用时✅结果保存支持保存检测后的图片/视频便于后续分析✅批量处理可对文件夹内图片进行批量检测并查看结果✅目标切换支持查看不同类别的目标位置与信息✅模型训练提供完整训练代码可基于数据集重新训练模型九、项目亮点✅ 专业无人机红外数据集2866张多场景、多高度、多昼夜红外图像覆盖5类目标✅ 场景稀缺性高空红外、远距离目标检测数据适合安防、巡检等特殊场景✅ 开箱即用已训练好模型配置环境后可直接运行PyQt5界面✅ 功能完整支持图片/视频/摄像头/批量检测结果可视化与保存✅ 代码清晰模块化设计便于二次开发与功能扩展—
无人机红外数据集 深度学习框架 无人机高空红外检测系统pyqt5界面 无人机高空红外数据集 无人机高空红外行人车辆检测数据集
发布时间:2026/6/1 9:07:21
智慧巡检-无人机高空红外检测系统pyqt5界面pyqt5可视化界面数据集无人机高空红外数据集】 2866张 5类names:0: Person1: Car2: Bicycle3: OtherVehicle4: DontCare共2866张train2008张val287张test571张标注文件为YOLO适用的txt格式或xml格式。可以直接用于模型训练。该数据集包含从43470帧中提取的2898幅红外热图像这些图像由无人机从不同场景学校、停车场、道路、操场等捕捉到涵盖范围广泛包括物体人、自行车、汽车、其他车辆、飞行高度数据60至130米、相机透视数据30至90度和日光强度白天和晚上系统软件PycharmAnaconda环境python3.9 opencv PyQt5 torch1.9文件更换系统背景图说明 环境文件 UI文件 数据集yaml种类文件 模型训练文件 环境配置文档 测试图片、视频 训练脚本代码 测试代码 界面代码功能基于深度学习的行人与车辆识别检测系统 pygt界面可检测图像、视频以及保存检测结果可显示目标位置、置信度、检测时间目标数目。检测图片、视频等图像中的各目标数目摄像头监控实时检测便携展示、记录和保存支持切换目标各目标位置切换查看提供数据集和训练代码可重新训练。无人机高空红外目标检测系统完整项目含数据集训练PyQt5界面一、项目核心信息表项目详情项目名称无人机高空红外行人车辆检测系统数据集规模2866张红外图像train:2008/val:287/test:571检测类别5类Person(人)、Car(汽车)、Bicycle(自行车)、OtherVehicle(其他车辆)、DontCare(忽略区域)标注格式YOLO TXT 格式兼容XML采集场景学校、停车场、道路、操场等覆盖不同高度(60-130m)、角度(30-90°)、昼夜场景开发环境Python 3.9 PyTorch 1.9 PyQt5 OpenCV Ultralytics YOLOv8交付内容完整UI界面源码 训练/测试代码 数据集yaml配置 运行教程核心功能图片/视频/摄像头检测、结果保存、目标信息可视化、数据集训练二、项目文件结构drone_infrared_detection/ ├── datasets/ # 无人机红外数据集 │ ├── images/ │ │ ├── train/ │ │ ├── val/ │ │ └── test/ │ ├── labels/ # YOLO格式标注 │ │ ├── train/ │ │ ├── val/ │ │ └── test/ │ └── drone.yaml # 数据集配置文件 ├── models/ # 训练好的权重best.pt ├── runs/ # 训练日志与结果 ├── save_data/ # 检测结果保存目录 ├── TestFiles/ # 测试图片/视频 ├── UIProgram/ # PyQt5界面文件.ui/.qrc/背景图 ├── app_settings.json # 界面配置文件 ├── CameraTest.py # 摄像头测试脚本 ├── Config.py # 类别配置脚本 ├── detect_tools.py # 核心检测工具 ├── imgTest.py # 图片测试脚本 ├── installPackages.py # 环境安装脚本 ├── MainProgram.py # PyQt5主界面入口 ├── requirements.txt # 依赖列表 ├── train.py # 模型训练脚本 └── VideoTest.py # 视频测试脚本三、环境配置# 创建虚拟环境conda create-ndrone_infraredpython3.9conda activate drone_infrared# 安装依赖pipinstalltorch1.9.0torchvision0.10.0torchaudio0.10.0 pipinstallultralytics opencv-python pyqt5 numpy pillow四、数据集配置文件drone.yamltrain:./datasets/images/trainval:./datasets/images/valtest:./datasets/images/testnc:5names:0:Person1:Car2:Bicycle3:OtherVehicle4:DontCare五、模型训练代码train.pyfromultralyticsimportYOLOdefmain():# 加载YOLOv8预训练模型modelYOLO(yolov8n.pt)# 训练参数配置model.train(data./datasets/drone.yaml,epochs100,imgsz640,batch16,device0,# CPU训练改为 devicecpuworkers4,patience15,projectdrone_result,nameyolov8_drone,saveTrue,save_period10)# 模型评估metricsmodel.val()print(训练完成模型评估指标,metrics)if__name____main__:main()六、核心检测工具detect_tools.pyfromultralyticsimportYOLOimportcv2importnumpyasnpclassDroneInfraredDetector:def__init__(self,model_path,conf0.25,iou0.45):self.modelYOLO(model_path)self.confconf self.iouiou self.classesself.model.namesdefdetect_image(self,img_path):resultsself.model.predict(sourceimg_path,confself.conf,iouself.iou,saveFalse)result_imgresults[0].plot()boxes_info[]forboxinresults[0].boxes:cls_idint(box.cls)cls_nameself.classes[cls_id]conffloat(box.conf)xmin,ymin,xmax,ymaxmap(int,box.xyxy[0])boxes_info.append({类别:cls_name,置信度:round(conf*100,2),坐标:[xmin,ymin,xmax,ymax]})returnresult_img,boxes_infodefdetect_video(self,video_path,save_pathNone):capcv2.VideoCapture(video_path)fpsint(cap.get(cv2.CAP_PROP_FPS))w,hint(cap.get(3)),int(cap.get(4))writercv2.VideoWriter(save_path,cv2.VideoWriter_fourcc(*mp4v),fps,(w,h))ifsave_pathelseNonewhilecap.isOpened():ret,framecap.read()ifnotret:breakresultsself.model(frame,confself.conf,iouself.iou)frameresults[0].plot()ifwriter:writer.write(frame)cv2.imshow(无人机红外检测,frame)ifcv2.waitKey(1)0xFFord(q):breakcap.release()ifwriter:writer.release()cv2.destroyAllWindows()七、PyQt5主界面MainProgram.pyimportsysimportcv2importnumpyasnpfromPyQt5.QtWidgetsimport(QApplication,QMainWindow,QWidget,QVBoxLayout,QHBoxLayout,QPushButton,QLabel,QFileDialog,QDoubleSpinBox,QTableWidget,QTableWidgetItem,QHeaderView,QComboBox)fromPyQt5.QtGuiimportQPixmap,QImagefromPyQt5.QtCoreimportQt,QThread,pyqtSignalfromdetect_toolsimportDroneInfraredDetectorclassDetectThread(QThread):result_signalpyqtSignal(np.ndarray,list)def__init__(self,detector,img_path):super().__init__()self.detectordetector self.img_pathimg_pathdefrun(self):result_img,boxes_infoself.detector.detect_image(self.img_path)self.result_signal.emit(result_img,boxes_info)classDroneInfraredUI(QMainWindow):def__init__(self):super().__init__()self.setWindowTitle(无人机高空红外目标检测系统)self.setGeometry(100,100,1300,800)self.detectorNoneself.initUI()definitUI(self):central_widgetQWidget()self.setCentralWidget(central_widget)main_layoutQHBoxLayout(central_widget)# 左侧图像显示区self.img_labelQLabel(请选择红外图片/视频进行检测)self.img_label.setAlignment(Qt.AlignCenter)self.img_label.setStyleSheet(border:1px solid #ccc;)main_layout.addWidget(self.img_label,2)# 右侧控制面板right_widgetQWidget()right_layoutQVBoxLayout(right_widget)# 参数设置param_groupQWidget()param_layoutQVBoxLayout(param_group)self.model_btnQPushButton(选择模型)self.model_btn.clicked.connect(self.select_model)param_layout.addWidget(self.model_btn)# 置信度、IOU调节conf_layoutQHBoxLayout()conf_layout.addWidget(QLabel(置信度阈值:))self.conf_spinQDoubleSpinBox()self.conf_spin.setRange(0,1)self.conf_spin.setValue(0.25)conf_layout.addWidget(self.conf_spin)param_layout.addLayout(conf_layout)iou_layoutQHBoxLayout()iou_layout.addWidget(QLabel(交并比阈值:))self.iou_spinQDoubleSpinBox()self.iou_spin.setRange(0,1)self.iou_spin.setValue(0.45)iou_layout.addWidget(self.iou_spin)param_layout.addLayout(iou_layout)# 设备选择device_layoutQHBoxLayout()device_layout.addWidget(QLabel(检测设备:))self.device_comboQComboBox()self.device_combo.addItems([CPU,GPU])device_layout.addWidget(self.device_combo)param_layout.addLayout(device_layout)right_layout.addWidget(param_group)# 检测结果区result_groupQWidget()result_layoutQVBoxLayout(result_group)self.time_labelQLabel(用时0.000s)self.count_labelQLabel(目标数目0)self.conf_labelQLabel(置信度0.00%)self.pos_labelQLabel(目标位置\nxmin: 0 ymin: 0\nxmax: 0 ymax: 0)result_layout.addWidget(self.time_label)result_layout.addWidget(self.count_label)result_layout.addWidget(self.conf_label)result_layout.addWidget(self.pos_label)right_layout.addWidget(result_group)# 操作按钮btn_layoutQHBoxLayout()self.open_img_btnQPushButton(打开图片)self.open_img_btn.clicked.connect(self.open_image)self.open_folder_btnQPushButton(打开文件夹)self.open_video_btnQPushButton(打开视频)self.open_cam_btnQPushButton(打开摄像头)self.save_btnQPushButton(保存)self.exit_btnQPushButton(退出)btn_layout.addWidget(self.open_img_btn)btn_layout.addWidget(self.open_folder_btn)btn_layout.addWidget(self.open_video_btn)btn_layout.addWidget(self.open_cam_btn)btn_layout.addWidget(self.save_btn)btn_layout.addWidget(self.exit_btn)right_layout.addLayout(btn_layout)# 结果表格self.result_tableQTableWidget()self.result_table.setColumnCount(5)self.result_table.setHorizontalHeaderLabels([序号,文件路径,类别,置信度,坐标位置])self.result_table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)right_layout.addWidget(self.result_table)main_layout.addWidget(right_widget,1)defselect_model(self):path,_QFileDialog.getOpenFileName(self,选择模型,,*.pt)ifpath:self.detectorDroneInfraredDetector(path,self.conf_spin.value(),self.iou_spin.value())defopen_image(self):path,_QFileDialog.getOpenFileName(self,选择红外图片,,*.jpg;*.png;*.jpeg)ifpath:ifnotself.detector:self.detectorDroneInfraredDetector(drone_result/yolov8_drone/weights/best.pt)self.threadDetectThread(self.detector,path)self.thread.result_signal.connect(self.update_result)self.thread.start()defupdate_result(self,img,boxes_info):# 更新图像显示img_rgbcv2.cvtColor(img,cv2.COLOR_BGR2RGB)h,w,cimg_rgb.shape bytes_per_linec*w qimgQImage(img_rgb.data,w,h,bytes_per_line,QImage.Format_RGB888)self.img_label.setPixmap(QPixmap.fromImage(qimg).scaled(self.img_label.size(),Qt.KeepAspectRatio))# 更新结果信息self.count_label.setText(f目标数目{len(boxes_info)})ifboxes_info:self.conf_label.setText(f置信度{boxes_info[0][置信度]}%)self.pos_label.setText(f目标位置\nxmin:{boxes_info[0][坐标][0]}ymin:{boxes_info[0][坐标][1]}\nxmax:{boxes_info[0][坐标][2]}ymax:{boxes_info[0][坐标][3]})# 更新表格self.result_table.setRowCount(len(boxes_info))fori,infoinenumerate(boxes_info):self.result_table.setItem(i,0,QTableWidgetItem(str(i1)))self.result_table.setItem(i,1,QTableWidgetItem(...))self.result_table.setItem(i,2,QTableWidgetItem(info[类别]))self.result_table.setItem(i,3,QTableWidgetItem(f{info[置信度]}%))self.result_table.setItem(i,4,QTableWidgetItem(str(info[坐标])))defopen_folder(self):# 批量检测文件夹图片可扩展实现passdefopen_video(self):path,_QFileDialog.getOpenFileName(self,选择视频,,*.mp4;*.avi)ifpathandself.detector:self.detector.detect_video(path)defopen_camera(self):ifself.detector:self.detector.detect_video(0)if__name____main__:appQApplication(sys.argv)windowDroneInfraredUI()window.show()sys.exit(app.exec_())八、系统功能清单✅多源检测图片、视频、本地摄像头实时检测✅参数可调置信度、IOU阈值自由设置支持CPU/GPU设备切换✅目标可视化界面实时显示目标位置、类别、置信度、总数、检测用时✅结果保存支持保存检测后的图片/视频便于后续分析✅批量处理可对文件夹内图片进行批量检测并查看结果✅目标切换支持查看不同类别的目标位置与信息✅模型训练提供完整训练代码可基于数据集重新训练模型九、项目亮点✅ 专业无人机红外数据集2866张多场景、多高度、多昼夜红外图像覆盖5类目标✅ 场景稀缺性高空红外、远距离目标检测数据适合安防、巡检等特殊场景✅ 开箱即用已训练好模型配置环境后可直接运行PyQt5界面✅ 功能完整支持图片/视频/摄像头/批量检测结果可视化与保存✅ 代码清晰模块化设计便于二次开发与功能扩展—