Pixel2Mesh-Tensorflow2
Pixel2Mesh-Tensorflow2
請參考Github鏈接Pixel2Mesh TensorFlow2
語言選擇/Language: 中文 // English(To be completed)
此代碼主要是筆者為了本科畢設需要(將Pixel2Mesh遷移到移動設備上)而完成。因為Tensorflow 1.x版本受到限制,因此將Pixel2Mesh代碼進一步修改成Tensorflow 2.x版本。
代碼構成主要參考了如下鏈接。Pixel2Mesh//Pixel2Mesh++
非常感謝師兄師姐在此領域作出的貢獻。(此前已聯系Nanyang Wang師兄,本代碼的Blog和Github項目可以開源)
代碼主要基于CNN+GCN框架。
Dependencies
Requirements:
- Python 3.6+
- Tensorflow(version 2.0+)
- numpy
- …
本代碼在Tensorflow 2.4,CUDA 11.0,Ubuntu 20.04 ,硬件設備:GeForce GTX 1050 Ti上測試過。建議懶得配環境的同學用TF官網Docker,本代碼全程在Docker中調試運行(備注:由于過年在家期間用自己電腦跑的,未在實驗室,因此預訓練權重和Model暫且不放上來了、后續會補充。一個Epoch數據有35010個,跑完一個Epoch大概需要1.5h。loss在跑5-10個epoch后可收斂到4~6左右,三維重建后的模型較為精細。loss最低預估可收斂到4.5附近。)
Dataset
采用ShapeNet數據集,視角的Rendered方法來自3D-R2N2
訓練和測試的數據集可以在***data/train_list.txt***和***data/test_list.txt***中找到。具體數據集的下載可以從Pixel2Mesh++里下載。
Pre-trained Model
待完成
Quick demo
首先從下載Pre-trained Model,(鏈接待完成)。將下載好的demo放到指定位置,我的路徑是***results/coarse_mvp2m/models/20200222model***,你可以在代碼中更改自己預訓練模型的路徑。
之后在終端執行
python demo.py
輸入圖片及三維Mesh效果圖如下所示:(待完成)
Training
在配置好環境且數據集下載完成后,可以開始模型的訓練
Step1
首先在cfgs/mvp2m.yaml中將對應路徑設置成自己數據集所在的位置
- train_file_path: the path of your own train split file which contains training data name for each instance
- train_image_path: input image path
- train_data_path: ground-truth model path
- coarse_result_*: the configuration items related to the coarse intermediate mesh should be same as the training data
Step2
配置完對應的cfg文件,且在***train_mvp2m.py***中修改預訓練模型路徑后(記著將***pre_train***的選項由False改為True Default:False)。
python train_mvp2m.py
Test
暫且沒寫,目前用不上。后續會跟進。
Statement
This software is for research purpose only.
Please contact me for the licence of commercial purposes. All rights are preserved.
Contact
Yann Qi (email: yannqi@qq.com)
License
Apache License version 2.0
總結
以上是生活随笔為你收集整理的Pixel2Mesh-Tensorflow2的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 相机和雷达外参联合标定
- 下一篇: Google Play 下载 apk