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

人臉與關(guān)鍵點(diǎn)檢測(cè):YOLO5Face實(shí)戰(zhàn)

這篇具有很好參考價(jià)值的文章主要介紹了人臉與關(guān)鍵點(diǎn)檢測(cè):YOLO5Face實(shí)戰(zhàn)。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

人臉與關(guān)鍵點(diǎn)檢測(cè):YOLO5Face實(shí)戰(zhàn)
Github:https://github.com/deepcam-cn/yolov5-face

導(dǎo)讀:居然花了一天時(shí)間把該項(xiàng)目復(fù)現(xiàn),主要是折騰在數(shù)據(jù)集格式上,作者居然在train2yolo中居然把Widerface訓(xùn)練集(12000+張圖)重新一張一張保存,不這么還出bug,原因是無(wú)法讀到數(shù)據(jù)緩存;在評(píng)估階段,val2yolo也沒(méi)用上。搬運(yùn)工,一個(gè)字,肝!



一、設(shè)置

Step by step

克隆倉(cāng)庫(kù),進(jìn)入conda環(huán)境

git clone https://github.com/deepcam-cn/yolov5-face.git

conda activate pytorch-cifar

測(cè)試模型
下載作者預(yù)訓(xùn)練的YOLO5m-face模型,并測(cè)試單張圖片效果。運(yùn)行detectface如下:

人臉與關(guān)鍵點(diǎn)檢測(cè):YOLO5Face實(shí)戰(zhàn)

      "args": [
          // // // to run train2yolo:
          // "data/widerface/train",
          // "data/widerface/train/labels"

          // // // to run val2yolo:
          // "data/widerface",
          // "data/widerface/val/labels"

          // // to run detect_face
          // "--img-size", "640",
          // "--weights", "weights/yolov5m-face.pt",


          // to train on widerface
          // "CUDA_VISIBLE_DEVICES"," 0, ",
          "--data", "data/widerface.yaml",
          "--cfg", "models/yolov5s.yaml",
          "--weights", "weights/yolov5s.pt"
      ]

以上是launch.json的配置參數(shù),分別對(duì)應(yīng)幾個(gè)任務(wù)。其中運(yùn)行train2yolo.py,巨慢;val2yolo,可以忽略。

二、訓(xùn)練

2.1 準(zhǔn)備數(shù)據(jù):

推薦去官網(wǎng)http://shuoyang1213.me/WIDERFACE/
下載widerface數(shù)據(jù)集,分別下載train、val、test三個(gè)包。本人參考RetinaFace下載的數(shù)據(jù)集不全面。

由于官網(wǎng)沒(méi)找到人臉關(guān)鍵點(diǎn)的標(biāo)注文本,在開(kāi)頭git鏈接YOLO5face可以下載帶有keypoint的annotation文件。整個(gè)文件結(jié)構(gòu)如下:

(base) wqt@ser2024:NewProjects$ ln -s ~/Datasets/widerface  yolov5-face/data/
//

yolov5-face
│   README.md
│   ...   
│data
| └─widerface
│         └───test
|                 └───images
|                 └───labels
│         └───train
|                 └───images
|                 └───labels
|                      └───0..._1_5.jpg
|                      └───0..._1_5.txt
│         └───val

目錄畫(huà)得有點(diǎn)丑,但為了說(shuō)明詳細(xì),也是拼了老命。

下載預(yù)訓(xùn)練好的yolo5檢測(cè)模型,由于本工程基于的yolo版本比較舊(最新6.0版)久,下載鏈接參考:
https://github.com/ultralytics/yolov5/releases/tag/v4.0

準(zhǔn)確讀取數(shù)據(jù)路徑,在widerface.yaml修改為:

train: /home/wqt/NewProjects/yolov5-face/data/widerface/train/labels  
val: /home/wqt/NewProjects/yolov5-face/data/widerface/val/labels   

# number of classes
nc: 1

# class names
names: [ 'face']

運(yùn)行train,沒(méi)報(bào)錯(cuò),佛祖保佑!

autoanchor: Analyzing anchors... anchors/target = 4.02, Best Possible Recall (BPR) = 0.9997
Image sizes 800 train, 800 test
Using 4 dataloader workers
Logging results to runs/train/exp12
Starting training for 250 epochs...

     Epoch   gpu_mem       box       obj       cls  landmark     total   targets  img_size
     0/249     4.65G    0.1032   0.03953         0    0.1396    0.2823        25       800: 100%|

     Epoch   gpu_mem       box       obj       cls  landmark     total   targets  img_size
     1/249     5.01G   0.08159   0.03674         0   0.02959    0.1479        15       800: 100%|

訓(xùn)練還挺快,一個(gè)epoch才幾分鐘,共250epoch。

有關(guān)YOLO數(shù)據(jù)格式

原始的widerface標(biāo)注如下:

0--Parade/0_Parade_marchingband_1_849.jpg
1
449 330 122 149 0 0 0 0 0 0 

轉(zhuǎn)化為YOLO格式,如下:

0--Parade/0_Parade_marchingband_1_849.jpg
449 330 122 149 488.906 373.643 0.0 542.089 376.442 0.0 515.031 412.83 0.0 485.174 425.893 0.0 538.357 431.491 0.0 0.82

即:bbox (xywh) + (xi, yi, flag)
人臉與關(guān)鍵點(diǎn)檢測(cè):YOLO5Face實(shí)戰(zhàn)

COCO keypoints轉(zhuǎn)化為YOLO格式(17個(gè)人體關(guān)鍵點(diǎn)),以下圖片對(duì)應(yīng)的標(biāo)注如下:

0 0.686445 0.531960 0.082891 0.323967 0.667188 0.399061 1.000000 0.670312 0.396714 2.000000 0.000000 0.000000 0.000000 0.678125 0.394366 2.000000 0.000000 0.000000 0.000000 0.689063 0.415493 2.000000 0.696875 0.415493 2.000000 0.682813 0.469484 2.000000 0.671875 0.483568 2.000000 0.671875 0.516432 2.000000 0.656250 0.504695 2.000000 0.695312 0.530516 2.000000 0.706250 0.523474 2.000000 0.698438 0.610329 2.000000 0.709375 0.603286 2.000000 0.710938 0.680751 2.000000 0.717187 0.671362 2.000000

人臉與關(guān)鍵點(diǎn)檢測(cè):YOLO5Face實(shí)戰(zhàn)

訓(xùn)練了12h之后,實(shí)測(cè)結(jié)果如下:

  Epoch   gpu_mem       box       obj       cls  landmark     total   targets  img_size
   249/249     5.01G   0.03923   0.02193         0   0.00727   0.06844        18       800: 
               Class      Images     Targets           P           R      mAP@.5  mAP@.5:.95: 
                 all    3.22e+03    3.96e+04       0.576       0.723       0.715        0.34

即在WiderFace上取得了mAP@0.5=71.5%,mAP@mean=0.34

實(shí)測(cè)1:

人臉與關(guān)鍵點(diǎn)檢測(cè):YOLO5Face實(shí)戰(zhàn)
實(shí)測(cè)2:
人臉與關(guān)鍵點(diǎn)檢測(cè):YOLO5Face實(shí)戰(zhàn)

使用縮小五官的效果圖去測(cè)試,發(fā)現(xiàn)有不小誤差,例如嘴角的兩點(diǎn)偏差比較大。

三、評(píng)估

上述模型訓(xùn)練完畢后,需要評(píng)估在Widerface上的性能,運(yùn)行test_widerface,并配置如下。

   //to test on the widerface
    "--weights", "runs/train/exp12/weights/best.pt",
    "--save_folder", "./widerface_evaluate/widerface_txt/",
    "--dataset_folder", "data/widerface/val/images/",
    "--folder_pict", "data/widerface/val/wider_val.txt"

val2yolo.py跑了那么久,結(jié)果還是用原來(lái)的widerface/val,并且要修改代碼如下:

  # for image_path in tqdm(glob.glob(os.path.join(testset_folder, '*'))):
  for image_path in tqdm(glob.glob(os.path.join(testset_folder, '*', "*.jpg"))):
(pytorch-cifar) wqt@ser2024:yolov5-face$ cd widerface_evaluate/
(pytorch-cifar) wqt@ser2024:widerface_evaluate$ python evaluation.py 

進(jìn)入評(píng)估程序,顯示如下:

Reading Predictions : 100%|
Processing easy: 100%|
Processing medium: 100%|
Processing hard: 100%|
==================== Results ====================
Easy   Val AP: 0.9430954074066416
Medium Val AP: 0.9235452692977046
Hard   Val AP: 0.8268421552890463
=================================================

與作者訓(xùn)練的性能對(duì)比,在yolov5s情況下,取得:
Easy 94.3% <(94.67%)
Med 92.4% <(92.75%)
Easy 82.7% <(83.03%)

都比作者給出的情況稍微低一些。

人臉與關(guān)鍵點(diǎn)檢測(cè):YOLO5Face實(shí)戰(zhàn)

參考:

https://blog.csdn.net/cliu1_16/article/details/120665458文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-461820.html

到了這里,關(guān)于人臉與關(guān)鍵點(diǎn)檢測(cè):YOLO5Face實(shí)戰(zhàn)的文章就介紹完了。如果您還想了解更多內(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)文章

  • OpenCV 入門(mén)教程:人臉檢測(cè)和關(guān)鍵點(diǎn)定位

    人臉檢測(cè)和關(guān)鍵點(diǎn)定位是計(jì)算機(jī)視覺(jué)中的重要任務(wù),用于在圖像或視頻中自動(dòng)檢測(cè)人臉并定位人臉關(guān)鍵點(diǎn),如眼睛、鼻子、嘴巴等。這項(xiàng)技術(shù)在人臉識(shí)別、表情分析、姿態(tài)估計(jì)等領(lǐng)

    2024年02月15日
    瀏覽(20)
  • pytorch實(shí)現(xiàn)AI小設(shè)計(jì)-1:Resnet50人臉68關(guān)鍵點(diǎn)檢測(cè)

    pytorch實(shí)現(xiàn)AI小設(shè)計(jì)-1:Resnet50人臉68關(guān)鍵點(diǎn)檢測(cè)

    ? ? ? ? 本項(xiàng)目是AI入門(mén)的應(yīng)用項(xiàng)目,后續(xù)可以補(bǔ)充內(nèi)容完善作為滿足個(gè)人需要。通過(guò)構(gòu)建自己的人臉數(shù)據(jù)集,此項(xiàng)目訓(xùn)練集為4580張圖片,測(cè)試集為2308張圖片,使用resnet50網(wǎng)絡(luò)進(jìn)行訓(xùn)練,最后進(jìn)行效果展示。本項(xiàng)目也提供了量化內(nèi)容,便于在硬件上部署。 ????????研究A

    2024年01月18日
    瀏覽(18)
  • 《數(shù)字圖像處理》dlib人臉檢測(cè)獲取關(guān)鍵點(diǎn),delaunay三角劃分,實(shí)現(xiàn)人臉的幾何變換warpping,接著實(shí)現(xiàn)兩幅人臉圖像之間的漸變合成morphing

    《數(shù)字圖像處理》dlib人臉檢測(cè)獲取關(guān)鍵點(diǎn),delaunay三角劃分,實(shí)現(xiàn)人臉的幾何變換warpping,接著實(shí)現(xiàn)兩幅人臉圖像之間的漸變合成morphing

    ? ? ? ?這學(xué)期在上《數(shù)字圖像處理》這門(mén)課程,老師布置了幾個(gè)大作業(yè),自己和同學(xué)一起討論完成后,感覺(jué)還挺有意思的,就想著把這個(gè)作業(yè)整理一下 : ? 目錄 1.實(shí)驗(yàn)任務(wù)和要求 2.實(shí)驗(yàn)原理 3.實(shí)驗(yàn)代碼 3.1利用人臉特征點(diǎn)檢測(cè)工具dlib獲取人臉關(guān)鍵點(diǎn) 目錄 1.實(shí)驗(yàn)任務(wù)和要求

    2024年02月03日
    瀏覽(18)
  • 2D人臉關(guān)鍵點(diǎn)轉(zhuǎn)3D人臉關(guān)鍵點(diǎn)的映射~頭部姿態(tài)筆記

    2D人臉關(guān)鍵點(diǎn)轉(zhuǎn)3D人臉關(guān)鍵點(diǎn)的映射~頭部姿態(tài)筆記

    對(duì)通過(guò)相機(jī)參數(shù)計(jì)算圖像上的二維坐標(biāo)到三維坐標(biāo)的映射進(jìn)行簡(jiǎn)單探討。 ????????學(xué)習(xí)的話直接看他們的就好,我僅是拾人牙慧,拿GPT寫(xiě)給自己看的,圖也是直接搬運(yùn)的別人畫(huà)的,以下鏈接有很完善的理論研究和代碼提供。 https://medium.com/@susanne.thierfelder/head-pose-estimation

    2024年02月04日
    瀏覽(24)
  • 人臉68、29、21、14、5關(guān)鍵點(diǎn)標(biāo)注序號(hào)及對(duì)應(yīng)關(guān)系

    人臉68、29、21、14、5關(guān)鍵點(diǎn)標(biāo)注序號(hào)及對(duì)應(yīng)關(guān)系

    最近需要用到solvePnP算法[1]通過(guò)人臉關(guān)鍵點(diǎn)求解人臉姿態(tài),涉及到的數(shù)據(jù)集中關(guān)鍵點(diǎn)標(biāo)注數(shù)量不統(tǒng)一,但網(wǎng)上使用solvePnP算法時(shí)人臉模型比較好找到的是68個(gè)關(guān)鍵點(diǎn),因此需要找到模型的68個(gè)關(guān)鍵點(diǎn)中與其他幾種數(shù)量關(guān)鍵點(diǎn)的對(duì)應(yīng)關(guān)系。 目錄 98關(guān)鍵點(diǎn)標(biāo)注序號(hào) 68關(guān)鍵點(diǎn)標(biāo)注序號(hào)

    2024年02月08日
    瀏覽(213)
  • 使用opencv自制一個(gè)YOLO常規(guī)數(shù)據(jù)和關(guān)鍵點(diǎn)數(shù)據(jù)的標(biāo)注工具

    使用opencv自制一個(gè)YOLO常規(guī)數(shù)據(jù)和關(guān)鍵點(diǎn)數(shù)據(jù)的標(biāo)注工具

    工具由opencv編寫(xiě),可以直接生成YOLO所需要的標(biāo)簽(pose和常規(guī)標(biāo)簽) 代碼放到了文章末尾,以及百度云下載鏈接 首先放一段實(shí)際操作的視頻展示 yolov5數(shù)據(jù)集標(biāo)注,yolo-pose數(shù)據(jù)集標(biāo)注 按Q切換到下一張圖像 按T直接退出 按Y刪除當(dāng)前圖片和對(duì)應(yīng)標(biāo)簽 按R隱藏當(dāng)前內(nèi)容,繼續(xù)標(biāo)注完

    2024年02月11日
    瀏覽(17)
  • 關(guān)鍵點(diǎn)檢測(cè)SIFT算法筆記

    關(guān)鍵點(diǎn)檢測(cè)SIFT算法筆記

    ????????SIFT(Scale Invariant Feature Transform),尺度不變特征變換。具有旋轉(zhuǎn)不變性、尺度不變性、亮度變化保持不變性,是一種非常穩(wěn)定的局部特征。在目標(biāo)檢測(cè)和特征提取方向占據(jù)著重要的地位。 ? ? ? ? SIFT算法所查找到的關(guān)鍵點(diǎn)是一些很突出,不因光照、仿射變換和噪

    2024年02月16日
    瀏覽(19)
  • MediaPipe人體姿態(tài)、手指關(guān)鍵點(diǎn)檢測(cè)

    MediaPipe人體姿態(tài)、手指關(guān)鍵點(diǎn)檢測(cè)

    Mediapipe是google的一個(gè)開(kāi)源項(xiàng)目,用于構(gòu)建機(jī)器學(xué)習(xí)管道 提供了16個(gè)預(yù)訓(xùn)練模型的案例:人臉檢測(cè)、Face Mesh、虹膜、手、姿態(tài)、人體、人物分割、頭發(fā)分割、目標(biāo)檢測(cè)、Box Tracking、Instant Motion Tracking、3D目標(biāo)檢測(cè)、特征匹配、AutoFlip、MediaSequence、YouTube-8M 肢體識(shí)別本質(zhì)上還是分類(lèi)

    2024年02月08日
    瀏覽(28)
  • Pytorch+Python實(shí)現(xiàn)人體關(guān)鍵點(diǎn)檢測(cè)

    Pytorch+Python實(shí)現(xiàn)人體關(guān)鍵點(diǎn)檢測(cè)

    用Python+Pytorch工程代碼對(duì)人體進(jìn)行關(guān)鍵點(diǎn)檢測(cè)和骨架提取,并實(shí)現(xiàn)可視化。 物體檢測(cè)為許多視覺(jué)任務(wù)提供動(dòng)力,如實(shí)例分割、姿態(tài)估計(jì)、跟蹤和動(dòng)作識(shí)別。它在監(jiān)控、自動(dòng)駕駛和視覺(jué)答疑中有下游應(yīng)用。當(dāng)前的對(duì)象檢測(cè)器通過(guò)緊密包圍對(duì)象的軸向包圍框來(lái)表示每個(gè)對(duì)象。然后

    2024年02月09日
    瀏覽(21)

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

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

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

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

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包