mmdetection3d基于kitti数据集训练pointpillars模型
當(dāng)mmdetection3d環(huán)境安裝成功后,可看上一篇如何安裝mmdetection3d
mmdetection3d官網(wǎng):Log Analysis — MMDetection3D 1.0.0rc1 documentation
1 準(zhǔn)備工作
kitti數(shù)據(jù)集下載,下面是我的百度網(wǎng)盤里的kitti數(shù)據(jù)集,有需要的自取
鏈接: https://pan.baidu.com/s/1QlgVfl3vBbGEfF0QCo8N6A 提取碼: milu
1.1 創(chuàng)建數(shù)據(jù)目錄:
mkdir -p data/kitti/ImageSets data/kitti/testing data/kitti/training
也可以不通過(guò)終端輸入命令,直接在mmdetection3d/data/kitti目錄下新建ImageSets、testing、training這三個(gè)文件夾。
創(chuàng)建好之后,將下載的kitti數(shù)據(jù)集中的壓縮包全部解壓,將數(shù)據(jù)集對(duì)應(yīng)按照如下方式擺放。??
其中,ImageSets的內(nèi)容,是將數(shù)據(jù)集劃分為訓(xùn)練和測(cè)試及驗(yàn)證。
不會(huì)自己劃分也沒關(guān)系,官網(wǎng)文檔? ?,已經(jīng)給出具體方式了。
wget -c https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/test.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/test.txtwget -c https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/train.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/train.txtwget -c https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/val.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/val.txtwget -c https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/trainval.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/trainval.txt在終端依次輸入以上四條命令,執(zhí)行完后就可以看到上圖ImagSets文件夾下的內(nèi)容了。?其中內(nèi)容如下。
test.txt : 7518行? ? ? ? ? ? ? ? ? train.txt :3712行
val.txt : 3769行? ? ? ? ? ? ? ? ? ? ?trainval.txt : 7481行
1.2 數(shù)據(jù)預(yù)處理
以上準(zhǔn)備工作做好后,就可以進(jìn)行預(yù)處理了。
python tools/create_data.py kitti --root-path ./data/kitti --out-dir ./data/kitti --extra-tag kitti?
數(shù)據(jù)預(yù)處理完后,可以看到data/kitti目錄下生成了一些.pkl和.json文件。?
?1.3 開始訓(xùn)練數(shù)據(jù)
選擇相應(yīng)的模型配置文件,開始訓(xùn)練。
python tools/train.py configs/pointpillars/hv_pointpillars_secfpn_6x8_160e_kitti-3d-3class.py
訓(xùn)練過(guò)程時(shí)間有點(diǎn)久,不用一直在邊上等著。我大概訓(xùn)練了十幾個(gè)小時(shí)。?
1.4 開始測(cè)試
數(shù)據(jù)訓(xùn)練完,可以進(jìn)行測(cè)試了。
python tools/test.py configs/pointpillars/hv_pointpillars_secfpn_6x8_160e_kitti-3d-3class.py checkpoints/epoch_80.pth --eval mAP --options 'show=True' 'out_dir=./data/pointpillars/show_results'
注意:這條語(yǔ)句 checkpoints/epoch_80.pth 可能會(huì)報(bào)錯(cuò),你要找到你訓(xùn)練后生成的./epoch_80.pth放在了什么位置。例如我的測(cè)試代碼如下:
python tools/test.py configs/pointpillars/hv_pointpillars_secfpn_6x8_160e_kitti-3d-3class.py work_dirs/hv_pointpillars_secfpn_6x8_160e_kitti-3d-3class/epoch_80.pth --eval mAP --eval-options 'show=True' 'out_dir=./data/pointpillars/show_results'
當(dāng)出現(xiàn)如下所示結(jié)果,就OK了。
使用show=True,進(jìn)行可視化的時(shí)候,需要安裝open3d包,注意:版本問題,我最開始安裝的是open-python==0.7.0在可視化的時(shí)候,出現(xiàn)閃屏。?后來(lái)重新安裝了open3d==0.13.0成功可視化。
pip install open3d==0.13.0
?1.5 可視化結(jié)果
1、鼠標(biāo)可視化控制
- 鼠標(biāo)左鍵+?拖拽:可以旋轉(zhuǎn)3D圖形
- Ctrl+鼠標(biāo)左鍵+拖拽:可以移動(dòng)3D圖形
- 按下鼠標(biāo)滾動(dòng)鍵?+?拖拽:也是可以移動(dòng)3D圖形
- Shift?+?鼠標(biāo)左鍵?+?拖拽:可以翻轉(zhuǎn)3D圖形
- 滾動(dòng)鼠標(biāo)滾輪:放大和縮小3D圖形
- 按Q會(huì)顯示下一張測(cè)試圖片
- 按D會(huì)進(jìn)行深度捕捉(捕捉的深度圖會(huì)保存到mmdetection3d目錄下)
- H:打印幫助信息
- P或PrtScn:截圖當(dāng)前的視圖
- O:捕獲當(dāng)前的渲染設(shè)置
- Alt+Enter:在全屏和窗口模式之間切換
2 、點(diǎn)云顏色控制
- 0:默認(rèn)的點(diǎn)云顏色渲染,默認(rèn)點(diǎn)云被渲染成灰色
- 1:渲染點(diǎn)云顏色,和0的時(shí)候效果一樣
- 2:把x的坐標(biāo)值作為顏色渲染
- 3:把y的坐標(biāo)值作為顏色渲染
- 4:把z的坐標(biāo)值作為顏色渲染
- 9:正常顏色,也是灰色
以上這些大家可以自己是嘗試一下
如:按D,捕捉的深度圖
按2,?把x的坐標(biāo)值作為顏色渲染。
以上就是pointpillars模型訓(xùn)練及可視化的全過(guò)程了。?
總結(jié)
以上是生活随笔為你收集整理的mmdetection3d基于kitti数据集训练pointpillars模型的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 印第安人的捕梦网 Dreamcatche
- 下一篇: 目前最新NIST随机数测试软件下载、安装