小吃車占道識(shí)別系統(tǒng) 業(yè)務(wù)場景:航拍識(shí)別道路小吃車違規(guī)占道經(jīng)營,機(jī)載 AI 告警輸出,單類別:snack_cart小吃車)
智慧飛行-大疆無人機(jī)M4系列機(jī)載算法【小吃車違規(guī)占道經(jīng)營識(shí)別】1、支持M4系列、M4D系列、M400型號(hào)2、提供設(shè)備SN碼即可遠(yuǎn)程下發(fā)部署提供部署支持3、識(shí)別提供1類告警標(biāo)簽小吃車大疆M4/M4D/M400 無人機(jī)小吃車占道識(shí)別系統(tǒng)業(yè)務(wù)場景航拍識(shí)別道路小吃車違規(guī)占道經(jīng)營機(jī)載AI告警輸出單類別snack_cart小吃車數(shù)據(jù)集yaml配置 snack_cart.yamlnc:1names:0:snack_carttrain:./datasets/snack_cart/images/trainval:./datasets/snack_cart/images/valtest:./datasets/snack_cart/images/testYOLOv11n訓(xùn)練代碼 train_snack.pyfromultralyticsimportYOLOif__name____main__:modelYOLO(yolo11n.pt)resultsmodel.train(datasnack_cart.yaml,epochs65,imgsz640,batch8,device0,workers2,conf0.25,iou0.45,projectuav_snack_cart,namem4_air_exp)#驗(yàn)證評(píng)估m(xù)etricsmodel.val()print(fmAP50?95:{metrics.box.map})#本地圖片推理model.predict(source./test_images,saveTrue,conf0.35)機(jī)載業(yè)務(wù)邏輯簡易Python模擬代碼模擬大疆機(jī)載SDK業(yè)務(wù)流程功能讀取無人機(jī)回傳圖像檢測小吃車觸發(fā)告警輸出目標(biāo)坐標(biāo)、數(shù)量適配M4/M4D/M400業(yè)務(wù)下發(fā)fromultralyticsimportYOLOimporttimeclassUavSnackCartDetect:def__init__(self,weight_path./weights/best.pt,conf_thresh0.35):self.modelYOLO(weight_path)self.conf_threshconf_threshdefdetect_frame(self,frame):輸入無人機(jī)實(shí)時(shí)幀返回檢測結(jié)果、告警標(biāo)志outputsself.model.predict(frame,confself.conf_thresh,saveFalse,verboseFalse)[0]detect_list[]alert_flagFalseforboxinoutputs.boxes:cls_idint(box.cls)cls_nameoutputs.names[cls_id]conffloat(box.conf)x1,y1,x2,y2map(int,box.xyxy[0])detect_list.append({class:cls_name,confidence:conf,bbox:[x1,y1,x2,y2]})alert_flagTrue#識(shí)別到小吃車觸發(fā)占道告警result{alert:alert_flag,target_count:len(detect_list),targets:detect_list,timestamp:time.time()}returnresultif__name____main__:detect_engineUavSnackCartDetect()#傳入無人機(jī)回傳圖片importcv2 imgcv2.imread(uav_sample.jpg)resdetect_engine.detect_frame(img)print(檢測輸出結(jié)果,res)ifres[alert]:print(f【告警】檢測到小吃車占道數(shù)量{res[target_count]})PyQt5地面站簡易演示代碼模擬地面接收無人機(jī)告警importsysimportcv2fromPyQt5.QtWidgetsimport*fromPyQt5.QtGuiimport*fromPyQt5.QtCoreimport*classGroundStation(QMainWindow):def__init__(self):super().__init__()self.setWindowTitle(無人機(jī)小吃車占道識(shí)別地面演示端)self.resize(1000,700)self.detectUavSnackCartDetect()self.img_labelQLabel()self.img_label.setFixedSize(700,520)self.alert_textQTextEdit()self.alert_text.setReadOnly(True)self.btn_openQPushButton(加載無人機(jī)航拍圖像)self.btn_open.clicked.connect(self.load_uav_img)v_layoutQVBoxLayout()v_layout.addWidget(self.img_label)v_layout.addWidget(self.btn_open)v_layout.addWidget(QLabel(告警日志))v_layout.addWidget(self.alert_text)central_widgetQWidget()central_widget.setLayout(v_layout)self.setCentralWidget(central_widget)defload_uav_img(self):file,_QFileDialog.getOpenFileName(self,選擇航拍圖片,,*.jpg *.png)ifnotfile:returnimgcv2.imread(file)rgb_imgcv2.cvtColor(img,cv2.COLOR_BGR2RGB)detect_resself.detect.detect_frame(img)forobjindetect_res[targets]:x1,y1,x2,y2obj[bbox]cv2.rectangle(rgb_img,(x1,y1),(x2,y2),(255,120,0),2)cv2.putText(rgb_img,f{obj[class]}{obj[confidence]:.2f},(x1,y1-8),cv2.FONT_HERSHEY_SIMPLEX,0.6,(255,120,0),1)logf[{QDateTime.currentDateTime().toString(hh:mm:ss)}] 告警狀態(tài):{detect_res[alert]}目標(biāo)數(shù):{detect_res[target_count]}\nself.alert_text.append(log)q_imgQImage(rgb_img.data,rgb_img.shape[1],rgb_img.shape[0],QImage.Format_RGB888)self.img_label.setPixmap(QPixmap.fromImage(q_img).scaled(self.img_label.size(),Qt.KeepAspectRatio))if__name____main__:appQApplication(sys.argv)winGroundStation()win.show()sys.exit(app.exec_())環(huán)境依賴pipinstallultralytics opencv-python pyqt5說明模型訓(xùn)練完成后可針對(duì)大疆M4/M4D/M400做模型轉(zhuǎn)換rknn/onnx用于機(jī)載部署提供設(shè)備SN碼遠(yuǎn)程下發(fā)部署告警輸出識(shí)別到snack_cart小吃車即輸出占道告警返回目標(biāo)數(shù)量、圖像坐標(biāo)、時(shí)間戳適配場景城市道路無人機(jī)巡檢識(shí)別流動(dòng)小吃車違規(guī)占道經(jīng)營。關(guān)鍵詞大疆M400M4M4D無人機(jī)機(jī)載AI小吃車識(shí)別占道經(jīng)營檢測城市巡檢低空治理YOLO機(jī)載部署備選標(biāo)題大疆M4系列無人機(jī)機(jī)載小吃車占道經(jīng)營目標(biāo)識(shí)別算法城市低空治理?無人機(jī)航拍小吃車違規(guī)占道檢測數(shù)據(jù)集與算法適配M400機(jī)載端小吃車流動(dòng)攤販識(shí)別檢測系統(tǒng)