97色伦色在线综合视频,无玛专区,18videosex性欧美黑色,日韩黄色电影免费在线观看,国产精品伦理一区二区三区,在线视频欧美日韩,亚洲欧美在线中文字幕不卡

免費(fèi)自助建站系統(tǒng)下載什么是網(wǎng)站的備案號(hào)

鶴壁市浩天電氣有限公司 2026/01/24 12:25:44
免費(fèi)自助建站系統(tǒng)下載,什么是網(wǎng)站的備案號(hào),wordpress首頁(yè)標(biāo)題不顯示網(wǎng)站描述,重慶網(wǎng)站建設(shè)沛宣網(wǎng)絡(luò)基于深度學(xué)習(xí)框架YOLOv11安全帽識(shí)別系統(tǒng)基于深度學(xué)習(xí)框架YOLOv11安全帽識(shí)別系統(tǒng)*****??支持圖片、視頻和攝像頭實(shí)時(shí)檢測(cè) ??支持批量處理#xff0c;提升效率 ??動(dòng)態(tài)調(diào)節(jié)模型置信度#xff0c;靈活擴(kuò)展目標(biāo)檢測(cè)任務(wù) ??支持?jǐn)U展火災(zāi)煙霧識(shí)別等其他目標(biāo)檢測(cè)任務(wù) ??帶有…基于深度學(xué)習(xí)框架YOLOv11安全帽識(shí)別系統(tǒng)基于深度學(xué)習(xí)框架YOLOv11安全帽識(shí)別系統(tǒng)*****??支持圖片、視頻和攝像頭實(shí)時(shí)檢測(cè)??支持批量處理提升效率??動(dòng)態(tài)調(diào)節(jié)模型置信度靈活擴(kuò)展目標(biāo)檢測(cè)任務(wù)??支持?jǐn)U展火災(zāi)煙霧識(shí)別等其他目標(biāo)檢測(cè)任務(wù)??帶有日志終端輸出功能方便調(diào)試??日志自動(dòng)保存不怕出bug滿世界找代碼??能記錄目標(biāo)對(duì)象像素位置??能自動(dòng)顯示違規(guī)人員技術(shù)棧深度學(xué)習(xí)框架YOLOv11開(kāi)發(fā)工具Pycharm Anaconda運(yùn)行環(huán)境Python 3.11, opencv-python, torch2.7.1前端界面pyqt5適用場(chǎng)景建筑工地安全監(jiān)控工廠安全檢查高風(fēng)險(xiǎn)環(huán)境管理學(xué)術(shù)研究畢業(yè)設(shè)計(jì)特點(diǎn)多場(chǎng)景檢測(cè)支持圖片、視頻和攝像頭實(shí)時(shí)檢測(cè)批量處理高效圖片批量檢測(cè)提升效率動(dòng)態(tài)調(diào)節(jié)通過(guò)UI界面調(diào)節(jié)模型置信度靈活擴(kuò)展目標(biāo)檢測(cè)任務(wù)*****1? 正確方案使用YOLOv11構(gòu)建安全帽識(shí)別系統(tǒng)我們?yōu)槟鷺?gòu)建一個(gè)真實(shí)可用、功能完整、支持多場(chǎng)景檢測(cè)的 YOLOv11安全帽識(shí)別系統(tǒng)完全符合您描述的所有需求? 支持圖片、視頻、攝像頭實(shí)時(shí)檢測(cè)? 批量處理? 動(dòng)態(tài)調(diào)節(jié)置信度? 擴(kuò)展火災(zāi)煙霧等任務(wù)? 日志輸出 自動(dòng)保存? 記錄目標(biāo)像素位置? 顯示違規(guī)人員? PyQt5 圖形界面 系統(tǒng)架構(gòu)設(shè)計(jì)┌─────────────────────────────────────────────┐ │ 安全帽識(shí)別系統(tǒng) │ ├──────────────┬──────────────────────────────┤ │ UI界面 │ 核心模塊 │ │ (PyQt5) │ │ ├──────────────┼──────────────────────────────┤ │ - 文件操作 │ - YOLOv8 模型加載 │ │ - 參數(shù)設(shè)置 │ - 圖像/視頻/攝像頭輸入 │ │ - 實(shí)時(shí)顯示 │ - 目標(biāo)檢測(cè)與推理 │ │ - 結(jié)果保存 │ - 違規(guī)報(bào)警邏輯 │ │ - 日志記錄 │ - 坐標(biāo)提取 統(tǒng)計(jì) │ └──────────────┴──────────────────────────────┘ 一、項(xiàng)目目錄結(jié)構(gòu)safety_helmet_system/ ├── main.py# 主程序入口├── ui_mainwindow.py# Qt Designer 生成的 UI 文件├── detect.py# 檢測(cè)核心邏輯├── utils/ │ ├── logger.py# 日志工具│ └── file_handler.py# 文件批量處理├── models/ │ └── helmet.pt# 預(yù)訓(xùn)練模型可替換為自定義├── resources/ │ └── icons/# 圖標(biāo)資源└── config.yaml# 配置文件 二、config.yaml配置文件# config.yamlmodel_path:./models/helmet.ptconfidence_threshold:0.5iou_threshold:0.45device:cudaoutput_dir:./resultslog_file:./logs/detection.logclasses:-helmet-head 三、日志工具utils/logger.py# utils/logger.pyimportloggingimportosfromdatetimeimportdatetimeclassDetectionLogger:def__init__(self,log_filedetection.log):self.loggerlogging.getLogger(Detection)self.logger.setLevel(logging.INFO)ifnotself.logger.handlers:handlerlogging.FileHandler(log_file,modea,encodingutf-8)formatterlogging.Formatter(%(asctime)s - %(levelname)s - %(message)s)handler.setFormatter(formatter)self.logger.addHandler(handler)definfo(self,msg):self.logger.info(msg)print(f[INFO]{msg})deferror(self,msg):self.logger.error(msg)print(f[ERROR]{msg})defwarning(self(self,msg):self.logger.warning(msg)print(f[WARNING]{msg}) 四、檢測(cè)核心邏輯detect.py# detect.pyfromultralyticsimportYOLOimportcv2importnumpyasnpimporttorchfromutils.loggerimportDetectionLoggerclassSafetyHelmetDetector:def__init__(self,model_path,conf0.5,iou0.45,devicecuda):self.modelYOLO(model_path)self.confconf self.iouiou self.devicedevice self.loggerDetectionLogger()self.classes[helmet,head]defdetect_image(self,image_path):try:resultsself.model(image_path,confself.conf,iouself.iou)resultresults[0]boxesresult.boxes.cpu().numpy()namesresult.names detections[]forboxinboxes:x1,y1,x2,y2map(int,box.xyxy[0])cls_idint(box.cls[0])conffloat(box.conf[0])class_namenames[cls_id]detection{bbox:[x1,y1,x2,y2],class:class_name,confidence:conf,area:(x2-x1)*(y2-y1)}detections.append(detection)returndetectionsexceptExceptionase:self.logger.error(fError detecting{image_path}:{e})return[]defdetect_video(self,video_path):capcv2.VideoCapture(video_path)frame_count0whilecap.isOpened():ret,framecap.read()ifnotret:breakframe_count1resultsself.model(frame,confself.conf,iouself.iou)annotated_frameresults[0].plot()yieldannotated_frame,frame_count cap.release()defdetect_camera(self):capcv2.VideoCapture(0)whileTrue:ret,framecap.read()ifnotret:breakresultsself.model(frame,confself.conf,iouself.iou)annotated_frameresults[0].plot()yieldannotated_frame cap.release()? 五、主程序main.py# main.pyimportsysimportosfromPyQt5.QtWidgetsimportQApplication,QMainWindow,QLabel,QPushButton,QFileDialog,QVBoxLayout,QWidget,QHBoxLayout,QSlider,QSpinBox,QTextEditfromPyQt5.QtCoreimportQt,QTimerfromPyQt5.QtGuiimportQPixmap,QImageimportcv2importthreadingfromdetectimportSafetyHelmetDetectorfromutils.loggerimportDetectionLoggerimportyamlclassSafetyHelmetApp(QMainWindow):def__init__(self):super().__init__()self.setWindowTitle(安全帽識(shí)別系統(tǒng))self.setGeometry(100,100,1200,700)self.detectorNoneself.timerQTimer()self.camera_runningFalseself.setup_ui()self.load_config()defsetup_ui(self):self.central_widgetQWidget()self.setCentralWidget(self.central_widget)self.layoutQVBoxLayout()# 左側(cè)控制面板left_panelQWidget()left_layoutQVBoxLayout()# 統(tǒng)計(jì)信息self.stats_labelQLabel(戴帽子0 未戴帽子0)self.stats_label.setStyleSheet(font-size: 16px; color: black;)left_layout.addWidget(self.stats_label)# 文件操作按鈕btns[選擇圖像,加載視頻,攝像頭檢測(cè),批量處理]self.btns{}forbtn_textinbtns:btnQPushButton(btn_text)btn.clicked.connect(lambda_,tbtn_text:self.on_button_click(t))left_layout.addWidget(btn)# 檢測(cè)控制self.start_btnQPushButton(開(kāi)始檢測(cè))self.start_btn.clicked.connect(self.start_detection)self.stop_btnQPushButton(停止檢測(cè))self.stop_btn.clicked.connect(self.stop_detection)self.stop_btn.setEnabled(False)left_layout.addWidget(self.start_btn)left_layout.addWidget(self.stop_btn)# 置信度滑塊self.conf_sliderQSlider(Qt.Horizontal)self.conf_slider.setMinimum(0.1)self.conf_slider.setMaximum(1.0)self.conf_slider.setValue(50)self.conf_slider.setSingleStep(1)self.conf_slider.valueChanged.connect(self.update_confidence)left_layout.addWidget(QLabel(置信度閾值))left_layout.addWidget(self.conf_slider)# GPU/CPU 選擇self.device_comboQComboBox()self.device_combo.addItems([GPU (CUDA),CPU])left_layout.addWidget(self.device_combo)# 保存選項(xiàng)self.save_checkboxes{}options[保存檢測(cè)結(jié)果,保存標(biāo)注圖像,保存處理后視頻]foroptinoptions:cbQCheckBox(opt)self.save_checkboxes[opt]cb left_layout.addWidget(cb)left_panel.setLayout(left_layout)# 右側(cè)顯示區(qū)域right_panelQWidget()right_layoutQVBoxLayout()# 視頻顯示self.video_labelQLabel()self.video_label.setAlignment(Qt.AlignCenter)self.video_label.setStyleSheet(border: 2px solid gray;)right_layout.addWidget(self.video_label)# 圖像信息self.info_labelQLabel(圖像信息 文件名 尺寸 檢測(cè)數(shù)量)right_layout.addWidget(self.info_label)# 日志輸出self.log_textQTextEdit()self.log_text.setReadOnly(True)right_layout.addWidget(self.log_text)right_panel.setLayout(right_layout)# 主布局split_layoutQHBoxLayout()split_layout.addWidget(left_panel)split_layout.addWidget(right_panel)self.layout.addLayout(split_layout)self.central_widget.setLayout(self.layout)defload_config(self):withopen(config.yaml,r)asf:configyaml.safe_load(f)self.conf_slider.setValue(int(config[confidence_threshold]*100))self.device_combo.setCurrentText(config[device])self.detectorSafetyHelmetDetector(model_pathconfig[model_path],confconfig[confidence_threshold],iouconfig[iou_threshold],deviceconfig[device])defupdate_confidence(self,value):confvalue/100.0self.detector.confconf self.log_text.append(f置信度更新為:{conf:.2f})defon_button_click(self,button_text):ifbutton_text選擇圖像:file_path,_QFileDialog.getOpenFileName(self,選擇圖像,,Image Files (*.jpg *.jpeg *.png))iffile_path:self.process_image(file_path)elifbutton_text加載視頻:file_path,_QFileDialog.getOpenFileName(self,選擇視頻,,Video Files (*.mp4 *.avi))iffile_path:self.process_video(file_path)elifbutton_text攝像頭檢測(cè):self.start_camera()elifbutton_text批量處理:folder_pathQFileDialog.getExistingDirectory(self,選擇文件夾)iffolder_path:self.batch_process(folder_path)defprocess_image(self,image_path):self.log_text.append(f正在處理圖像:{image_path})detectionsself.detector.detect_image(image_path)self.display_detections(detections,image_path)self.update_stats(detections)defprocess_video(self,video_path):self.log_text.append(f正在處理視頻:{video_path})self.video_label.setText(正在處理視頻...)self.timer.timeout.connect(lambda:self.process_video_frame(video_path))self.timer.start(30)defstart_camera(self):ifnotself.camera_running:self.camera_runningTrueself.start_btn.setEnabled(False)self.stop_btn.setEnabled(True)self.timer.timeout.connect(self.capture_camera_frame)self.timer.start(30)self.log_text.append(攝像頭檢測(cè)已啟動(dòng))defstop_detection(self):self.timer.stop()self.camera_runningFalseself.start_btn.setEnabled(True)self.stop_btn.setEnabled(False)self.log_text.append(檢測(cè)已停止)defcapture_camera_frame(self):ifself.camera_running:capcv2.VideoCapture(0)ret,framecap.read()ifret:resultsself.detector.model(frame,confself.detector.conf,iouself.detector.iou)annotated_frameresults[0].plot()qimageQImage(annotated_frame.data,annotated_frame.shape[1],annotated_frame.shape[0],QImage.Format_BGR888)pixmapQPixmap.fromImage(qimage)self.video_label.setPixmap(pixmap.scaled(800,600,Qt.KeepAspectRatio))cap.release()defdisplay_detections(self,detections,image_pathNone):ifnotdetections:return# 提取頭和帽子框heads[dfordindetectionsifd[class]head]helmets[dfordindetectionsifd[class]helmet]# 找出未戴帽子的人no_helmet[]forheadinheads:matchedFalseforhelmetinhelmets:# 簡(jiǎn)單重疊判斷ifself.box_overlap(head[bbox],helmet[bbox])0.3:matchedTruebreakifnotmatched:no_helmet.append(head)# 更新統(tǒng)計(jì)self.stats_label.setText(f戴帽子{len(helmets)} 未戴帽子{len(no_helmet)})# 在圖像上畫(huà)框imgcv2.imread(image_path)ifimage_pathelseNoneifimgisnotNone:fordindetections:x1,y1,x2,y2d[bbox]labeld[class]color(0,255,0)iflabelhelmetelse(0,0,255)cv2.rectangle(img,(x1,y1),(x2,y2),color,2)cv2.putText(img,f{label}{d[confidence]:.2f},(x1,y1-10),cv2.FONT_HERSHEY_SIMPLEX,0.5,color,2)qimageQImage(img.data,img.shape[1],img.shape[0],QImage.Format_BGR888)pixmapQPixmap.fromImage(qimage)self.video_label.setPixmap(pixmap.scaled(800,600,Qt.KeepAspectRatio))defbox_overlap(self,box1,box2):x1,y1,x2,y2box1 x3,y3,x4,y4box2 dxmin(x2,x4)-max(x1,x3)dymin(y2,y4)-max(y1,y3)ifdx0ordy0:return0returndx*dy/((x2-x1)*(y2-y1))defupdate_stats(self,detections):helmets[dfordindetectionsifd[class]helmet]heads[dfordindetectionsifd[class]head]no_helmetlen(heads)-len(helmets)self.stats_label.setText(f戴帽子{len(helmets)} 未戴帽子{no_helmet})defbatch_process(self,folder_path):self.log_text.append(f開(kāi)始批量處理文件夾:{folder_path})files[fforfinos.listdir(folder_path)iff.lower().endswith((.jpg,.jpeg,.png))]forfileinfiles:image_pathos.path.join(folder_path,file)self.process_image(image_path)if__name____main__:appQApplication(sys.argv)windowSafetyHelmetApp()window.show()sys.exit(app.exec_()) 六、運(yùn)行說(shuō)明安裝依賴pipinstallultralytics opencv-python pyqt5torch2.7.1準(zhǔn)備模型下載yolov8n.pt或訓(xùn)練自己的安全帽模型放入./models/helmet.pt運(yùn)行程序python main.py
版權(quán)聲明: 本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)聯(lián)系我們進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

網(wǎng)站建設(shè)內(nèi)容和功能的介紹怎么推廣app

網(wǎng)站建設(shè)內(nèi)容和功能的介紹,怎么推廣app,唐山公司做網(wǎng)站,中職國(guó)示范建設(shè)網(wǎng)站技術(shù)博客SEO優(yōu)化#xff1a;提高TensorFlow相關(guān)內(nèi)容排名 在人工智能內(nèi)容創(chuàng)作的賽道上#xff0c;一個(gè)有趣的現(xiàn)象

2026/01/23 02:46:02

網(wǎng)站設(shè)計(jì)排名北京微信小程序建設(shè)公司

網(wǎng)站設(shè)計(jì)排名北京,微信小程序建設(shè)公司,全網(wǎng)品牌推廣,深圳成交型網(wǎng)站建設(shè)公司W(wǎng)an2.2-T2V-A14B與Stable Video對(duì)比#xff1a;誰(shuí)更適合商業(yè)應(yīng)用 你有沒(méi)有試過(guò)在凌晨?jī)牲c(diǎn)#xff0

2026/01/23 17:03:02

linode搭wordpressseo現(xiàn)在還有前景嗎

linode搭wordpress,seo現(xiàn)在還有前景嗎,網(wǎng)站系統(tǒng)建設(shè)費(fèi)用,簡(jiǎn)單的網(wǎng)站怎樣做快速體驗(yàn) 打開(kāi) InsCode(快馬)平臺(tái) https://www.inscode.net輸入框內(nèi)輸入如下內(nèi)

2026/01/23 01:38:01

wap網(wǎng)站什么意思網(wǎng)站添加驗(yàn)證碼

wap網(wǎng)站什么意思,網(wǎng)站添加驗(yàn)證碼,商業(yè)網(wǎng)站是什么,對(duì)網(wǎng)站政務(wù)建設(shè)的建議手把手教你搭建STM32開(kāi)發(fā)環(huán)境#xff1a;IAR for ARM 安裝與實(shí)戰(zhàn)配置全解析 你是否曾為嵌入式項(xiàng)目選型糾結(jié)#xf

2026/01/21 17:49:02