- Setup environment for COLMAP
- Setup environment for Gen6D
- Download all required data
- Load custom object in the model
- Allow prediction commands
- Clone the Gen6D repository
git clone https://github.com/liuyuan-pal/Gen6D.git
- Create a virtual environment with Python 3.6 using either pip/conda. Install all of the packages listed in
Gen6D/requirements.txt
. - Install COLMAP for Windows. Note: make sure to install the CUDA version.
- Download pretrained models. The file structure should look like:
Gen6D
|-- data
|-- model
|-- detector_pretrain
|-- model_best.pth
|-- selector_pretrain
|-- model_best.pth
|-- refiner_pretrain
|-- model_best.pth
- Create a sub-folder under
data
calledcustom
. Create another folder insidecustom
calledflourbag
. - Download the point cloud file
object_point_cloud.ply
and meta info filemeta_info.txt
. Place it in the Gen6D folder like this:
Gen6D
|-- data
|-- custom
|-- flourbag
|-- object_point_cloud.ply # object point cloud
|-- meta_info.txt # meta information about z+/x+ directions
- Download the
images
&colmap
folders (thecolmap
folder from here). Place them at the same level as the point cloud and meta info files.
Gen6D
|-- data
|-- custom
|-- flourbag
|-- object_point_cloud.ply # object point cloud
|-- meta_info.txt # meta information about z+/x+ directions
|-- images # images
|-- colmap # colmap project
- Install
ffmpeg
from here.
- Make sure the structure of the folder looks like this:
Gen6D
|-- data
|-- custom
|-- flourbag
|-- object_point_cloud.ply # object point cloud
|-- meta_info.txt # meta information about z+/x+ directions
|-- images # images
|-- colmap # colmap project
|-- video # create this new folder
|-- <test video>.mp4 # add your test videos in this folder
|-- model
|-- detector_pretrain
|-- model_best.pth
|-- selector_pretrain
|-- model_best.pth
|-- refiner_pretrain
|-- model_best.pth
|-- configs
|-- train
... etc
Here are some test videos: one, two.
- Run the following command with the appropriate parameters.
python3 predict.py --cfg configs/gen6d_pretrain.yaml --database custom/flourbag --video <path-to-video-mp4> --resolution 960 --transpose --output data/custom/flourbag/test --ffmpeg <path-to-ffmpeg-exe>
- Find your output in
data/custom/flourbag/test/
!