国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Python+Yolov5+Qt交通標(biāo)志特征識(shí)別窗體界面相片視頻攝像頭

這篇具有很好參考價(jià)值的文章主要介紹了Python+Yolov5+Qt交通標(biāo)志特征識(shí)別窗體界面相片視頻攝像頭。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

程序示例精選
Python+Yolov5+Qt交通標(biāo)志特征識(shí)別窗體界面相片視頻攝像頭
如需安裝運(yùn)行環(huán)境或遠(yuǎn)程調(diào)試,見(jiàn)文章底部個(gè)人QQ名片,由專業(yè)技術(shù)人員遠(yuǎn)程協(xié)助!

前言

這篇博客針對(duì)《Python+Yolov5+Qt交通標(biāo)志特征識(shí)別窗體界面相片視頻攝像頭》編寫代碼,代碼整潔,規(guī)則,易讀。 學(xué)習(xí)與應(yīng)用推薦首選。


運(yùn)行結(jié)果

Python+Yolov5+Qt交通標(biāo)志特征識(shí)別窗體界面相片視頻攝像頭,Python,python,YOLO,qt,開(kāi)發(fā)語(yǔ)言,機(jī)器學(xué)習(xí),人工智能


文章目錄

一、所需工具軟件
二、使用步驟
???????1. 主要代碼
???????2. 運(yùn)行結(jié)果
三、在線協(xié)助

一、所需工具軟件

???????1. Python
???????2. Pycharm

二、使用步驟

代碼如下(示例):

def detect(save_img=False):
    source, weights, view_img, save_txt, imgsz = opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size
    webcam = source.isnumeric() or source.endswith('.txt') or source.lower().startswith(
        ('rtsp://', 'rtmp://', 'http://'))
 
    # Directories
    save_dir = Path(increment_path(Path(opt.project) / opt.name, exist_ok=opt.exist_ok))  # increment run
    (save_dir / 'labels' if save_txt else save_dir).mkdir(parents=True, exist_ok=True)  # make dir
 
    # Initialize
    set_logging()
    device = select_device(opt.device)
    half = device.type != 'cpu'  # half precision only supported on CUDA
 
    # Load model
    model = attempt_load(weights, map_location=device)  # load FP32 model
    stride = int(model.stride.max())  # model stride
    imgsz = check_img_size(imgsz, s=stride)  # check img_size
    if half:
        model.half()  # to FP16
 
    # Second-stage classifier
    classify = False
    if classify:
        modelc = load_classifier(name='resnet101', n=2)  # initialize
        modelc.load_state_dict(torch.load('weights/resnet101.pt', map_location=device)['model']).to(device).eval()
 
    # Set Dataloader
    vid_path, vid_writer = None, None
    if webcam:
        view_img = check_imshow()
        cudnn.benchmark = True  # set True to speed up constant image size inference
        dataset = LoadStreams(source, img_size=imgsz, stride=stride)
    else:
        save_img = True
        dataset = LoadImages(source, img_size=imgsz, stride=stride)
 
    # Get names and colors
    names = model.module.names if hasattr(model, 'module') else model.names
    colors = [[random.randint(0, 255) for _ in range(3)] for _ in names]
 
    # Run inference
    if device.type != 'cpu':
        model(torch.zeros(1, 3, imgsz, imgsz).to(device).type_as(next(model.parameters())))  # run once
    t0 = time.time()
        # Apply NMS
        pred = non_max_suppression(pred, opt.conf_thres, opt.iou_thres, classes=opt.classes, agnostic=opt.agnostic_nms)
        t2 = time_synchronized()
 
        # Apply Classifier
        if classify:
            pred = apply_classifier(pred, modelc, img, im0s)
 
        # Process detections
        for i, det in enumerate(pred):  # detections per image
            if webcam:  # batch_size >= 1
                p, s, im0, frame = path[i], '%g: ' % i, im0s[i].copy(), dataset.count
            else:
                p, s, im0, frame = path, '', im0s, getattr(dataset, 'frame', 0)
 
            p = Path(p)  # to Path
            save_path = str(save_dir / p.name)  # img.jpg
            txt_path = str(save_dir / 'labels' / p.stem) + ('' if dataset.mode == 'image' else f'_{frame}')  # img.txt
            s += '%gx%g ' % img.shape[2:]  # print string
            gn = torch.tensor(im0.shape)[[1, 0, 1, 0]]  # normalization gain whwh
            if len(det):
                # Rescale boxes from img_size to im0 size
                det[:, :4] = scale_coords(img.shape[2:], det[:, :4], im0.shape).round()
 
                # Print results
 
                for c in det[:, -1].unique():
                    n = (det[:, -1] == c).sum()  # detections per class
                    s += f"{n} {names[int(c)]}{'s' * (n > 1)}, "  # add to string
 
  
 
                # Write results
                for *xyxy, conf, cls in reversed(det):
                    if save_txt:  # Write to file
                        xywh = (xyxy2xywh(torch.tensor(xyxy).view(1, 4)) / gn).view(-1).tolist()  # normalized xywh
                        line = (cls, *xywh, conf) if opt.save_conf else (cls, *xywh)  # label format
                        with open(txt_path + '.txt', 'a') as f:
                            f.write(('%g ' * len(line)).rstrip() % line + '\n')
 
                    if save_img or view_img:  # Add bbox to image
                        label = f'{names[int(cls)]} {conf:.2f}'
                        plot_one_box(xyxy, im0, label=label, color=colors[int(cls)], line_thickness=3)
 
            # Print time (inference + NMS)
            print(f'{s}Done. ({t2 - t1:.3f}s)')
 
            # Stream results
            if view_img:
                cv2.imshow(str(p), im0)
                cv2.waitKey(1)  # 1 millisecond
 
            # Save results (image with detections)
            if save_img:
                if dataset.mode == 'image':
                    cv2.imwrite(save_path, im0)
                else:  # 'video'
                    if vid_path != save_path:  # new video
                        vid_path = save_path
                        if isinstance(vid_writer, cv2.VideoWriter):
                            vid_writer.release()  # release previous video writer
 
                        fourcc = 'mp4v'  # output video codec
                        fps = vid_cap.get(cv2.CAP_PROP_FPS)
                        w = int(vid_cap.get(cv2.CAP_PROP_FRAME_WIDTH))
                        h = int(vid_cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
                        vid_writer = cv2.VideoWriter(save_path, cv2.VideoWriter_fourcc(*fourcc), fps, (w, h))
                    vid_writer.write(im0)
 
    if save_txt or save_img:
        s = f"\n{len(list(save_dir.glob('labels/*.txt')))} labels saved to {save_dir / 'labels'}" if save_txt else ''
        print(f"Results saved to {save_dir}{s}")
 
    print(f'Done. ({time.time() - t0:.3f}s)')
 
 
if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('--weights', nargs='+', type=str, default='yolov5_crack_wall_epoach150_batchsize5.pt', help='model.pt path(s)')
    parser.add_argument('--source', type=str, default='data/images', help='source')  # file/folder, 0 for webcam
    parser.add_argument('--img-size', type=int, default=640, help='inference size (pixels)')
    parser.add_argument('--conf-thres', type=float, default=0.4, help='object confidence threshold')
    parser.add_argument('--iou-thres', type=float, default=0.45, help='IOU threshold for NMS')
    parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu')
    parser.add_argument('--view-img', action='store_true', help='display results')
    parser.add_argument('--save-txt', action='store_true', help='save results to *.txt')
    parser.add_argument('--save-conf', action='store_true', help='save confidences in --save-txt labels')
    parser.add_argument('--classes', nargs='+', type=int, help='filter by class: --class 0, or --class 0 2 3')
    parser.add_argument('--agnostic-nms', action='store_true', help='class-agnostic NMS')
    parser.add_argument('--augment', action='store_true', help='augmented inference')
    parser.add_argument('--update', action='store_true', help='update all models')
    parser.add_argument('--project', default='runs/detect', help='save results to project/name')
    parser.add_argument('--name', default='exp', help='save results to project/name')
    parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment')
    opt = parser.parse_args()
    
    print(opt)
    check_requirements()
 
    with torch.no_grad():
        if opt.update:  # update all models (to fix SourceChangeWarning)
            for opt.weights in ['yolov5s.pt', 'yolov5m.pt', 'yolov5l.pt', 'yolov5x.pt']:
                detect()
                strip_optimizer(opt.weights)
        else:
            detect()

運(yùn)行結(jié)果

Python+Yolov5+Qt交通標(biāo)志特征識(shí)別窗體界面相片視頻攝像頭,Python,python,YOLO,qt,開(kāi)發(fā)語(yǔ)言,機(jī)器學(xué)習(xí),人工智能

三、在線協(xié)助:

如需安裝運(yùn)行環(huán)境或遠(yuǎn)程調(diào)試,見(jiàn)文章底部個(gè)人 QQ 名片,由專業(yè)技術(shù)人員遠(yuǎn)程協(xié)助!

1)遠(yuǎn)程安裝運(yùn)行環(huán)境,代碼調(diào)試
2)Visual Studio, Qt, C++, Python編程語(yǔ)言入門指導(dǎo)
3)界面美化
4)軟件制作
5)云服務(wù)器申請(qǐng)
6)網(wǎng)站制作

當(dāng)前文章連接:https://blog.csdn.net/alicema1111/article/details/132666851
個(gè)人博客主頁(yè):https://blog.csdn.net/alicema1111?type=blog
博主所有文章點(diǎn)這里:https://blog.csdn.net/alicema1111?type=blog

博主推薦:
Python人臉識(shí)別考勤打卡系統(tǒng):
https://blog.csdn.net/alicema1111/article/details/133434445
Python果樹(shù)水果識(shí)別:https://blog.csdn.net/alicema1111/article/details/130862842
Python+Yolov8+Deepsort入口人流量統(tǒng)計(jì):https://blog.csdn.net/alicema1111/article/details/130454430
Python+Qt人臉識(shí)別門禁管理系統(tǒng):https://blog.csdn.net/alicema1111/article/details/130353433
Python+Qt指紋錄入識(shí)別考勤系統(tǒng):https://blog.csdn.net/alicema1111/article/details/129338432
Python Yolov5火焰煙霧識(shí)別源碼分享:https://blog.csdn.net/alicema1111/article/details/128420453
Python+Yolov8路面橋梁墻體裂縫識(shí)別:https://blog.csdn.net/alicema1111/article/details/133434445
文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-769565.html

到了這里,關(guān)于Python+Yolov5+Qt交通標(biāo)志特征識(shí)別窗體界面相片視頻攝像頭的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Android嵌入自己訓(xùn)練的yolov5模型(tfLite)交通標(biāo)志

    Android嵌入自己訓(xùn)練的yolov5模型(tfLite)交通標(biāo)志

    目錄 第一步:下載模型與修改參數(shù) 第二步:標(biāo)注數(shù)據(jù) 第三步:開(kāi)始訓(xùn)練 第四步:yolov5轉(zhuǎn)為tfLite模型 第五步:我們可以檢測(cè)一下tfLite是否可用 第六步:下載官方的示例代碼 第七步:修改代碼 第八步:運(yùn)行軟件 第九步:優(yōu)化速率 效果圖 參考:【精選】手把手教你使用YOLOV5訓(xùn)練自己的目標(biāo)

    2024年04月12日
    瀏覽(55)
  • 基于Yolov8的中國(guó)交通標(biāo)志(CCTSDB)識(shí)別檢測(cè)系統(tǒng)

    基于Yolov8的中國(guó)交通標(biāo)志(CCTSDB)識(shí)別檢測(cè)系統(tǒng)

    目錄 1.Yolov8介紹 2.紙箱破損數(shù)據(jù)集介紹 2.1數(shù)據(jù)集劃分 2.2 通過(guò)voc_label.py得到適合yolov8訓(xùn)練需要的 2.3生成內(nèi)容如下 3.訓(xùn)練結(jié)果分析 ?????????Ultralytics YOLOv8是Ultralytics公司開(kāi)發(fā)的YOLO目標(biāo)檢測(cè)和圖像分割模型的最新版本。YOLOv8是一種尖端的、最先進(jìn)的(SOTA)模型,它建立在先

    2024年02月09日
    瀏覽(50)
  • win下YOLOv7訓(xùn)練自己的數(shù)據(jù)集(交通標(biāo)志TT100K識(shí)別)

    win下YOLOv7訓(xùn)練自己的數(shù)據(jù)集(交通標(biāo)志TT100K識(shí)別)

    預(yù)測(cè)結(jié)果: 數(shù)據(jù)集的準(zhǔn)備包括數(shù)據(jù)集適配YOLO格式的重新分配以及相應(yīng)配置文件的書(shū)寫,此處可查看博主的TT100K2yolo的重新分配博文,該文章包括數(shù)據(jù)集劃分,配置文件書(shū)寫,以及最終的數(shù)據(jù)集層級(jí)目錄組織,可以直接提供給下一步進(jìn)行訓(xùn)練。 需要注意的是數(shù)據(jù)集的yaml文件有

    2024年02月06日
    瀏覽(24)
  • 競(jìng)賽 深度學(xué)習(xí) opencv python 實(shí)現(xiàn)中國(guó)交通標(biāo)志識(shí)別

    競(jìng)賽 深度學(xué)習(xí) opencv python 實(shí)現(xiàn)中國(guó)交通標(biāo)志識(shí)別

    ?? 優(yōu)質(zhì)競(jìng)賽項(xiàng)目系列,今天要分享的是 ?? 基于深度學(xué)習(xí)的中國(guó)交通標(biāo)志識(shí)別算法研究與實(shí)現(xiàn) 該項(xiàng)目較為新穎,適合作為競(jìng)賽課題方向,學(xué)長(zhǎng)非常推薦! ??學(xué)長(zhǎng)這里給一個(gè)題目綜合評(píng)分(每項(xiàng)滿分5分) 難度系數(shù):4分 工作量:4分 創(chuàng)新點(diǎn):3分 ?? 更多資料, 項(xiàng)目分享: http

    2024年02月06日
    瀏覽(15)
  • 軟件杯 深度學(xué)習(xí) opencv python 實(shí)現(xiàn)中國(guó)交通標(biāo)志識(shí)別_1

    軟件杯 深度學(xué)習(xí) opencv python 實(shí)現(xiàn)中國(guó)交通標(biāo)志識(shí)別_1

    ?? 優(yōu)質(zhì)競(jìng)賽項(xiàng)目系列,今天要分享的是 ?? 基于深度學(xué)習(xí)的中國(guó)交通標(biāo)志識(shí)別算法研究與實(shí)現(xiàn) 該項(xiàng)目較為新穎,適合作為競(jìng)賽課題方向,學(xué)長(zhǎng)非常推薦! ??學(xué)長(zhǎng)這里給一個(gè)題目綜合評(píng)分(每項(xiàng)滿分5分) 難度系數(shù):4分 工作量:4分 創(chuàng)新點(diǎn):3分 ?? 更多資料, 項(xiàng)目分享: http

    2024年03月17日
    瀏覽(30)
  • Python交通標(biāo)志識(shí)別基于卷積神經(jīng)網(wǎng)絡(luò)的保姆級(jí)教程(Tensorflow)

    Python交通標(biāo)志識(shí)別基于卷積神經(jīng)網(wǎng)絡(luò)的保姆級(jí)教程(Tensorflow)

    項(xiàng)目介紹 TensorFlow2.X 搭建卷積神經(jīng)網(wǎng)絡(luò)(CNN),實(shí)現(xiàn)交通標(biāo)志識(shí)別。搭建的卷積神經(jīng)網(wǎng)絡(luò)是類似VGG的結(jié)構(gòu)(卷積層與池化層反復(fù)堆疊,然后經(jīng)過(guò)全連接層,最后用softmax映射為每個(gè)類別的概率,概率最大的即為識(shí)別結(jié)果)。 其他項(xiàng)目 水果蔬菜識(shí)別:基于卷積神經(jīng)網(wǎng)絡(luò)的水果識(shí)別

    2024年02月05日
    瀏覽(44)
  • Opencv交通標(biāo)志識(shí)別

    本文使用的數(shù)據(jù)集包含43種交通標(biāo)志,使用opencv以及卷積神經(jīng)網(wǎng)絡(luò)訓(xùn)練模型,識(shí)別交通標(biāo)志,使用pyqt5制作交通標(biāo)志識(shí)別GUI的界面。 如視頻中所示,可以選擇交通標(biāo)志,然后可以進(jìn)行圖像預(yù)處理操作,如灰度化,邊緣檢測(cè)等,最后可以點(diǎn)擊識(shí)別按鈕進(jìn)行識(shí)別。 交通標(biāo)志識(shí)別

    2024年02月11日
    瀏覽(25)
  • 基于深度學(xué)習(xí),機(jī)器學(xué)習(xí),卷積神經(jīng)網(wǎng)絡(luò),OpenCV的交通標(biāo)志識(shí)別交通標(biāo)志檢測(cè)

    基于深度學(xué)習(xí),機(jī)器學(xué)習(xí),卷積神經(jīng)網(wǎng)絡(luò),OpenCV的交通標(biāo)志識(shí)別交通標(biāo)志檢測(cè)

    在本文中,使用Python編程語(yǔ)言和庫(kù)Keras和OpenCV建立CNN模型,成功地對(duì)交通標(biāo)志分類器進(jìn)行分類,準(zhǔn)確率達(dá)96%。開(kāi)發(fā)了一款交通標(biāo)志識(shí)別應(yīng)用程序,該應(yīng)用程序具有圖片識(shí)別和網(wǎng)絡(luò)攝像頭實(shí)時(shí)識(shí)別兩種工作方式。 設(shè)計(jì)項(xiàng)目案例演示地址: 鏈接 畢業(yè)設(shè)計(jì)代做一對(duì)一指導(dǎo)項(xiàng)目方向涵

    2024年02月02日
    瀏覽(96)
  • 畢業(yè)設(shè)計(jì)-基于機(jī)器視覺(jué)的交通標(biāo)志識(shí)別系統(tǒng)

    畢業(yè)設(shè)計(jì)-基于機(jī)器視覺(jué)的交通標(biāo)志識(shí)別系統(tǒng)

    目錄 前言 課題背景和意義 實(shí)現(xiàn)技術(shù)思路 一、交通標(biāo)志識(shí)別系統(tǒng) 二、交通標(biāo)志識(shí)別整體方案 三、實(shí)驗(yàn)分析 四、總結(jié) 實(shí)現(xiàn)效果圖樣例 最后 ? ? ??大四是整個(gè)大學(xué)期間最忙碌的時(shí)光,一邊要忙著備考或?qū)嵙?xí)為畢業(yè)后面臨的就業(yè)升學(xué)做準(zhǔn)備,一邊要為畢業(yè)設(shè)計(jì)耗費(fèi)大量精力。近幾

    2024年02月03日
    瀏覽(19)
  • 基于深度學(xué)習(xí)的交通標(biāo)志檢測(cè)和識(shí)別(從原理到環(huán)境配置/代碼運(yùn)行)

    基于深度學(xué)習(xí)的交通標(biāo)志檢測(cè)和識(shí)別(從原理到環(huán)境配置/代碼運(yùn)行)

    項(xiàng)目是一個(gè)基于Python和OpenCV的交通標(biāo)志檢測(cè)和識(shí)別項(xiàng)目,旨在使用計(jì)算機(jī)視覺(jué)和深度學(xué)習(xí)技術(shù)對(duì)交通標(biāo)志進(jìn)行檢測(cè)和分類。本文將從介紹項(xiàng)目原理和框架開(kāi)始,詳細(xì)介紹該項(xiàng)目的實(shí)現(xiàn)過(guò)程和技術(shù)細(xì)節(jié),最后給出項(xiàng)目的安裝和使用方法。 Traffic-Sign-Detection項(xiàng)目的主要原理是使用

    2024年02月03日
    瀏覽(25)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包