From 6c8fa6b2dc9c8d66601a11443a999561a1169aaa Mon Sep 17 00:00:00 2001 From: Pradeep Kadubandi Date: Sat, 26 Feb 2022 15:32:58 -0800 Subject: [PATCH 1/3] pipenv environment file. Additional documentation and some fixes I needed on my local machine. --- Pipfile | 24 ++++++++++++++++++++++++ README.md | 4 ++++ lib/layers/setup.py | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 Pipfile diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..16a1922 --- /dev/null +++ b/Pipfile @@ -0,0 +1,24 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +pyassimp = "==4.1.3" +progressbar2 = "*" +opencv-python = "==4.2.0.34" +transforms3d = "*" +ipython = "*" +matplotlib = "*" +easydict = "*" +future = "*" +scipy = "*" +PyOpenGL = ">=3.1.0" +Pillow = "*" +PyYAML = "*" +Cython = "*" + +[dev-packages] + +[requires] +python_version = "3.8" diff --git a/README.md b/README.md index 4c1c4dc..36c2d5c 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,12 @@ Use python3. If ROS is needed, compile with python2. 1. Install [PyTorch](https://pytorch.org/) 2. Install Eigen from the Github source code [here](https://github.com/eigenteam/eigen-git-mirror) + - I installed not from github but using command 'sudo apt install libeigen3-dev'. This resulted in package getting installed at '/usr/include/eigen3' instead of '/usr/local/eigen3'. So I had to change the include_dirs value in $ROOT/lib/layers/setup.py accordingly. + - For newbies, I found the path of eigen3 on my system using 'dpkg -L libeigen3-dev' command. 3. Install Sophus from the Github source code [here](https://github.com/yuxng/Sophus) + - I followed this link 'https://chowdera.com/2021/06/20210602213411499x.html' to help with installing from github. This does install the package into '/usr/local/sophus', so I kept the second value for include_dirs in the $ROOT/lib/layers/setup.py file as is. + - Also, when trying to run the above setup.py file (as instructions below suggested), I got an error failing to include fmt/core.h. So I ended up installing fmt as well from Github (luckily the web link above actually has instructions for that too). And this is probably the reason $ROOT/lib/layers/setup.py uses '/usr/local/include' instead of '/usr/local/include/sophus'. 4. Install python packages ```Shell diff --git a/lib/layers/setup.py b/lib/layers/setup.py index 49fbaab..4adfb31 100644 --- a/lib/layers/setup.py +++ b/lib/layers/setup.py @@ -19,7 +19,7 @@ 'roi_pooling_kernel.cu', 'ROIAlign_cuda.cu', 'point_matching_loss_kernel.cu'], - include_dirs = ['/usr/local/include/eigen3', '/usr/local/include']) + include_dirs = ['/usr/include/eigen3', '/usr/local/include']) ], cmdclass={ 'build_ext': BuildExtension From 3904695ba564b75bff77d31b8b3ea177517c3dd5 Mon Sep 17 00:00:00 2001 From: Pradeep Kadubandi Date: Sat, 26 Feb 2022 16:24:27 -0800 Subject: [PATCH 2/3] Fix needed for latest pyyaml package. --- lib/fcn/config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/fcn/config.py b/lib/fcn/config.py index 832ccf1..af7a7de 100644 --- a/lib/fcn/config.py +++ b/lib/fcn/config.py @@ -373,8 +373,9 @@ def _merge_a_into_b(a, b): def cfg_from_file(filename): """Load a config file and merge it into the default options.""" import yaml + with open(filename, 'r') as f: - yaml_cfg = edict(yaml.load(f)) + yaml_cfg = edict(yaml.load(f, Loader=yaml.FullLoader)) _merge_a_into_b(yaml_cfg, __C) @@ -383,5 +384,5 @@ def yaml_from_file(filename): """Load a config file and merge it into the default options.""" import yaml with open(filename, 'r') as f: - yaml_cfg = edict(yaml.load(f)) + yaml_cfg = edict(yaml.load(f, Loader=yaml.FullLoader)) return yaml_cfg From 8a91c3a3928660ed030b7f653a9c67537d8e84ac Mon Sep 17 00:00:00 2001 From: Pradeep Kadubandi Date: Sat, 26 Feb 2022 16:25:05 -0800 Subject: [PATCH 3/3] Adding a VSCode launch.json file for debugging test_images.py script. --- .vscode/launch.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..0cbed47 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python: test_images", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/tools/test_images.py", + "console": "integratedTerminal", + "args": [ + "--gpu=0", "--imgdir=data/demo/", "--meta=data/demo/meta.yml", "--color=*color.png", + "--network=posecnn", "--pretrained=data/checkpoints/ycb_object/vgg16_ycb_object_self_supervision_epoch_8.checkpoint.pth", + "--dataset=ycb_object_test", "--cfg=experiments/cfgs/ycb_object.yml" + ], + "env": { + "PYTHONUNBUFFERED":"True", + "CUDA_VISIBLE_DEVICES":"0" + } + } + ] +} \ No newline at end of file