Skip to content

Commit 9da581d

Browse files
authored
Merge branch 'develop' into end-to-end-planning
2 parents 4afedfc + 3a08d24 commit 9da581d

File tree

79 files changed

+454
-311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+454
-311
lines changed

Diff for: .github/workflows/test_packages.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ jobs:
3939
- perception/speech_recognition
4040
- perception/skeleton_based_action_recognition
4141
- perception/semantic_segmentation
42-
- perception/object_detection_2d
42+
- perception/object_detection_2d/centernet
43+
- perception/object_detection_2d/detr
44+
- perception/object_detection_2d/gem
45+
- perception/object_detection_2d/ssd
46+
- perception/object_detection_2d/yolov3
47+
- perception/object_detection_2d/retinaface
4348
- perception/facial_expression_recognition
4449
# - perception/object_detection_3d
4550
# - control/mobile_manipulation
@@ -82,7 +87,12 @@ jobs:
8287
- perception/speech_recognition
8388
- perception/skeleton_based_action_recognition
8489
- perception/semantic_segmentation
85-
- perception/object_detection_2d
90+
- perception/object_detection_2d/centernet
91+
- perception/object_detection_2d/detr
92+
- perception/object_detection_2d/gem
93+
- perception/object_detection_2d/ssd
94+
- perception/object_detection_2d/yolov3
95+
- perception/object_detection_2d/retinaface
8696
- perception/facial_expression_recognition
8797
- perception/object_detection_3d
8898
- control/mobile_manipulation

Diff for: .github/workflows/tests_suite.yml

+25-5
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@ jobs:
7171
- perception/skeleton_based_action_recognition
7272
- perception/semantic_segmentation
7373
- control/mobile_manipulation
74-
- perception/object_detection_2d
74+
- perception/object_detection_2d/centernet
75+
- perception/object_detection_2d/detr
76+
- perception/object_detection_2d/gem
77+
- perception/object_detection_2d/ssd
78+
- perception/object_detection_2d/yolov3
79+
- perception/object_detection_2d/retinaface
7580
- simulation/human_model_generation
7681
- perception/facial_expression_recognition
7782
- control/single_demo_grasp
@@ -169,7 +174,12 @@ jobs:
169174
- perception/speech_recognition
170175
- perception/skeleton_based_action_recognition
171176
- perception/semantic_segmentation
172-
- perception/object_detection_2d
177+
- perception/object_detection_2d/centernet
178+
- perception/object_detection_2d/detr
179+
- perception/object_detection_2d/gem
180+
- perception/object_detection_2d/ssd
181+
- perception/object_detection_2d/yolov3
182+
- perception/object_detection_2d/retinaface
173183
- perception/facial_expression_recognition
174184
# - perception/object_detection_3d
175185
# - control/mobile_manipulation
@@ -195,7 +205,7 @@ jobs:
195205
- name: Test Wheel
196206
run: |
197207
export DISABLE_BCOLZ_AVX2=true
198-
sudo apt -y install python3.8-venv libfreetype6-dev git build-essential cmake python3-dev wget libopenblas-dev libsndfile1 libboost-dev libeigen3-dev
208+
sudo apt -y install python3.8-venv libfreetype6-dev git build-essential cmake python3-dev wget libopenblas-dev libsndfile1 libboost-dev python3-dev
199209
python3 -m venv venv
200210
source venv/bin/activate
201211
pip install wheel
@@ -233,7 +243,12 @@ jobs:
233243
- perception/speech_recognition
234244
- perception/skeleton_based_action_recognition
235245
- perception/semantic_segmentation
236-
- perception/object_detection_2d
246+
- perception/object_detection_2d/centernet
247+
- perception/object_detection_2d/detr
248+
- perception/object_detection_2d/gem
249+
- perception/object_detection_2d/ssd
250+
- perception/object_detection_2d/yolov3
251+
- perception/object_detection_2d/retinaface
237252
- perception/facial_expression_recognition
238253
# - perception/object_detection_3d
239254
# - control/mobile_manipulation
@@ -303,7 +318,12 @@ jobs:
303318
- perception/speech_recognition
304319
- perception/skeleton_based_action_recognition
305320
- perception/semantic_segmentation
306-
- perception/object_detection_2d
321+
- perception/object_detection_2d/centernet
322+
- perception/object_detection_2d/detr
323+
- perception/object_detection_2d/gem
324+
- perception/object_detection_2d/ssd
325+
- perception/object_detection_2d/yolov3
326+
- perception/object_detection_2d/retinaface
307327
- perception/facial_expression_recognition
308328
- perception/object_detection_3d
309329
- control/mobile_manipulation

Diff for: .github/workflows/tests_suite_develop.yml

+24-4
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ jobs:
7070
- perception/skeleton_based_action_recognition
7171
- perception/semantic_segmentation
7272
- control/mobile_manipulation
73-
- perception/object_detection_2d
73+
- perception/object_detection_2d/centernet
74+
- perception/object_detection_2d/detr
75+
- perception/object_detection_2d/gem
76+
- perception/object_detection_2d/ssd
77+
- perception/object_detection_2d/yolov3
78+
- perception/object_detection_2d/retinaface
7479
- simulation/human_model_generation
7580
- perception/facial_expression_recognition
7681
- control/single_demo_grasp
@@ -169,7 +174,12 @@ jobs:
169174
- perception/speech_recognition
170175
- perception/skeleton_based_action_recognition
171176
- perception/semantic_segmentation
172-
- perception/object_detection_2d
177+
- perception/object_detection_2d/centernet
178+
- perception/object_detection_2d/detr
179+
- perception/object_detection_2d/gem
180+
- perception/object_detection_2d/ssd
181+
- perception/object_detection_2d/yolov3
182+
- perception/object_detection_2d/retinaface
173183
- perception/facial_expression_recognition
174184
# - perception/object_detection_3d
175185
# - control/mobile_manipulation
@@ -234,7 +244,12 @@ jobs:
234244
- perception/speech_recognition
235245
- perception/skeleton_based_action_recognition
236246
- perception/semantic_segmentation
237-
- perception/object_detection_2d
247+
- perception/object_detection_2d/centernet
248+
- perception/object_detection_2d/detr
249+
- perception/object_detection_2d/gem
250+
- perception/object_detection_2d/ssd
251+
- perception/object_detection_2d/yolov3
252+
- perception/object_detection_2d/retinaface
238253
- perception/facial_expression_recognition
239254
# - perception/object_detection_3d
240255
# - control/mobile_manipulation
@@ -305,7 +320,12 @@ jobs:
305320
- perception/speech_recognition
306321
- perception/skeleton_based_action_recognition
307322
- perception/semantic_segmentation
308-
- perception/object_detection_2d
323+
- perception/object_detection_2d/centernet
324+
- perception/object_detection_2d/detr
325+
- perception/object_detection_2d/gem
326+
- perception/object_detection_2d/ssd
327+
- perception/object_detection_2d/yolov3
328+
- perception/object_detection_2d/retinaface
309329
- perception/facial_expression_recognition
310330
- perception/object_detection_3d
311331
- control/mobile_manipulation

Diff for: CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Released on XX, XXth, 2022.
99
- Added support for modular pip packages allowing tools to be installed separately ([#201](https://github.com/opendr-eu/opendr/pull/201)).
1010
- Simplified the installation process for pip by including the appropriate post-installation scripts ([#201](https://github.com/opendr-eu/opendr/pull/201)).
1111
- Improved the structure of the toolkit by moving `io` from `utils` to `engine.helper` ([#201](https://github.com/opendr-eu/opendr/pull/201)).
12-
- Added support for `post-install` scripts and `opendr` dependencies in `.ini` files ([#201](https://github.com/opendr-eu/opendr/pull/201)).
12+
- Added support for `post-install` scripts and `opendr` dependencies in `.ini` files ([#201](https://github.com/opendr-eu/opendr/pull/201)).
13+
- Updated toolkit to support CUDA 11.2 and improved GPU support ([#215](https://github.com/opendr-eu/opendr/pull/215)).
1314
- Bug Fixes:
1415
- Updated wheel building pipeline to include missing files and removed unnecessary dependencies ([#200](https://github.com/opendr-eu/opendr/pull/200)).
1516
- `panoptic_segmentation/efficient_ps`: updated dataset preparation scripts to create correct validation ground truth ([#221](https://github.com/opendr-eu/opendr/pull/221)).

Diff for: Dockerfile-cuda

+2-30
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,17 @@
1-
FROM nvidia/cuda:11.0-base
1+
FROM nvidia/cuda:11.2.0-cudnn8-devel-ubuntu20.04
22

33
# Install dependencies
44
RUN apt-get update && \
55
apt-get --yes install git sudo apt-utils
66
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata
77

8-
# Install CUDA 10.2
9-
RUN apt-get --yes install gcc-8 g++-8 wget && \
10-
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 100 --slave /usr/bin/g++ g++ /usr/bin/g++-8 && \
11-
update-alternatives --auto gcc && \
12-
apt-get --yes install zlib1g-dev libbz2-dev libreadline-dev libssl-dev libsqlite3-dev libffi-dev && \
13-
wget https://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run && \
14-
wget http://people.cs.uchicago.edu/~kauffman/nvidia/cudnn/cudnn-10.2-linux-x64-v8.2.0.53.tgz
15-
16-
RUN sudo apt-get --yes install libxml2 && \
17-
sh cuda_10.2.89_440.33.01_linux.run --silent --toolkit --override --librarypath=/usr/local/cuda-10.2 && \
18-
ln -s /usr/local/cuda-10.2/ /usr/local/cuda && \
19-
tar -xzvf cudnn-10.2-linux-x64-v8.2.0.53.tgz && \
20-
cp cuda/include/cudnn.h /usr/local/cuda/include && \
21-
cp cuda/lib64/libcudnn* /usr/local/cuda/lib64 && \
22-
chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn* && \
23-
bash -c 'echo "/usr/local/cuda-10.2/lib64" > /etc/ld.so.conf.d/nvidia.conf' && \
24-
ln -sf /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.2.0 /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_adv_train.so.8 && \
25-
ln -sf /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8.2.0 /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8 && \
26-
ln -sf /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8.0.0 /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8 && \
27-
ln -sf /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8.2.0 /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8 && \
28-
ln -sf /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_ops_train.so.8.2.0 /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_ops_train.so.8 && \
29-
ln -sf /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8.2.0 /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8 && \
30-
ln -sf /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn.so.8.2.0 /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn.so.8 && \
31-
ldconfig
32-
338
# Add Tini
349
ENV TINI_VERSION v0.19.0
3510
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
3611
RUN chmod +x /tini
3712
ENTRYPOINT ["/tini", "--"]
3813

39-
# Avoid switching back to gcc9 when install build-essential
40-
RUN sudo apt-get --yes install build-essential && \
41-
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 100 --slave /usr/bin/g++ g++ /usr/bin/g++-8 && \
42-
update-alternatives --auto gcc
14+
RUN sudo apt-get --yes install build-essential
4315

4416
# Clone the repo and install the toolkit
4517
ENV OPENDR_DEVICE gpu

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ OpenDR aims to develop, train, deploy and evaluate deep learning models that imp
3737

3838
OpenDR can be installed in the following ways:
3939
1. By *cloning* this repository (CPU/GPU support)
40-
2. Using *pip* (CPU only)
40+
2. Using *pip* (CPU/GPU support only)
4141
3. Using *docker* (CPU/GPU support)
4242

4343
You can find detailed installation instruction in the [documentation](docs/reference/installation.md).

Diff for: bin/activate.sh

-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,4 @@ export PYTHONPATH=$OPENDR_HOME/src:$PYTHONPATH
44
export PYTHON=python3
55
export LD_LIBRARY_PATH=$OPENDR_HOME/lib:$LD_LIBRARY_PATH
66

7-
if [[ -z "${OPENDR_DEVICE}" ]]; then
8-
echo "[INFO] Set available device to CPU. You can manually change this by running 'export OPENDR_DEVICE=gpu'."
9-
export OPENDR_DEVICE=cpu
10-
fi
11-
127
source venv/bin/activate

Diff for: bin/install.sh

+10-4
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,19 @@ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main
3838
# Build OpenDR
3939
make install_compilation_dependencies
4040
make install_runtime_dependencies
41-
make libopendr
4241

4342
# If working on GPU install GPU dependencies as needed
4443
if [[ "${OPENDR_DEVICE}" == "gpu" ]]; then
45-
echo "[INFO] Installing mxnet-cu102==1.8.0. You can override this later if you are using a different CUDA version."
46-
pip3 install mxnet-cu102==1.8.0
44+
pip3 uninstall -y mxnet
45+
pip3 uninstall -y torch
46+
echo "[INFO] Replacing mxnet-cu112==1.8.0post0 to enable CUDA acceleration."
47+
pip3 install mxnet-cu112==1.8.0post0
48+
echo "[INFO] Replacing torch==1.9.0+cu111 to enable CUDA acceleration."
49+
pip3 install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
50+
echo "[INFO] Reinstalling detectronv2."
51+
pip3 install 'git+https://github.com/facebookresearch/detectron2.git'
4752
fi
4853

49-
deactivate
54+
make libopendr
5055

56+
deactivate

Diff for: dependencies/dependencies.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[runtime]
22
# 'python' and 'python-dependencies' keys expect a value in the Python requirements file format
33
# https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
4-
python=torch==1.7.1
4+
python=torch==1.9.0
55
wheel
66

77
[device]

Diff for: docs/reference/installation.md

+14-17
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ Using dockerfiles is strongly advised (please see below), unless you know what y
3636
Please also make sure that you have enough RAM available for the installation (about 4GB of free RAM is needed for the full installation/compilation).
3737

3838

39-
You can set the inference/training device using the `OPENDR_DEVICE` variable.
39+
If you want to install GPU-related dependencies, then you can appropriately set the `OPENDR_DEVICE` variable.
4040
The toolkit defaults to using CPU.
41-
If you want to use GPU, please set this variable accordingly:
41+
Therefore, if you want to use GPU, please set this variable accordingly *before* running the installation script:
4242
```bash
4343
export OPENDR_DEVICE=gpu
4444
```
@@ -49,24 +49,20 @@ source ./bin/activate.sh
4949
```
5050
Then, you are ready to use the toolkit!
5151

52+
**NOTE:** `OPENDR_DEVICE` does not alter the inference/training device at *runtime*.
53+
It only affects the dependency installation.
54+
You can use OpenDR API to change the inference device.
55+
5256
You can also verify the installation by using the supplied Python and C unit tests:
5357
```bash
5458
make unittest
5559
make ctests
5660
```
5761

58-
If you plan to use GPU-enabled functionalities, then you are advised to install [CUDA 10.2](https://developer.nvidia.com/cuda-10.2-download-archive).
59-
To do so, you can follow these steps:
60-
```bash
61-
sudo apt install gcc-8 g++-8 gcc-9 g++-9
62-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8 --slave /usr/bin/g++ g++ /usr/bin/g++-8
63-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9 --slave /usr/bin/g++ g++ /usr/bin/g++-9
64-
echo "Please switch to GCC 8"
65-
sudo update-alternatives --config gcc
66-
```
67-
Then, you can install CUDA, along CuDNN.
68-
You can also refer to this [dockerfile](https://github.com/opendr-eu/opendr/blob/master/Dockerfile-cuda) for installation instructions.
69-
Note that NVIDIA 30xx GPUs may not be fully supported, due to CUDA limitations.
62+
If you plan to use GPU-enabled functionalities, then you are advised to install [CUDA 11.2](https://developer.nvidia.com/cuda-11.2.0-download-archive), along with [CuDNN](https://developer.nvidia.com/cudnn).
63+
64+
**HINT:** All tests probe for the `TEST_DEVICE` enviromental variable when running.
65+
If this enviromental variable is set during testing, it allows for easily running all tests on a different device (e.g., setting `TEST_DEVICE=cuda:0` runs all tests on the first GPU of the system).
7066

7167
# Installing using *pip*
7268

@@ -95,14 +91,15 @@ This is not needed for newer CPUs.
9591
The same OpenDR package is used for both CPU and GPU systems.
9692
However, you need to have the appropriate GPU-enabled dependencies installed to use a GPU with OpenDR.
9793
If you plan to use GPU, then you should first install [mxnet-cuda](https://mxnet.apache.org/versions/1.4.1/install/index.html?platform=Linux&language=Python&processor=CPU) and [detectron2](https://detectron2.readthedocs.io/en/latest/tutorials/install.html).
98-
For example, if you stick with the default PyTorch version (1.7) and use CUDA10.2, then you can simply follow:
94+
For example, if you stick with the default PyTorch version (1.8) and use CUDA11.2, then you can simply follow:
9995
```bash
10096
sudo apt install python3.8-venv libfreetype6-dev git build-essential cmake python3-dev wget libopenblas-dev libsndfile1 libboost-dev libeigen3-dev
10197
python3 -m venv venv
10298
source venv/bin/activate
10399
pip install wheel
104-
pip install detectron2==0.5 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.7/index.html
105-
pip install mxnet-cu102==1.8.0
100+
pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
101+
pip install 'git+https://github.com/facebookresearch/detectron2.git'
102+
pip install mxnet-cu112==1.8.0post0
106103
pip install opendr-toolkit-engine
107104
pip install opendr-toolkit
108105
```

Diff for: docs/reference/object-detection-2d-yolov3.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The *yolov3* module contains the *YOLOv3DetectorLearner* class, which inherits f
55
### Class YOLOv3DetectorLearner
66
Bases: `engine.learners.Learner`
77

8-
The *YOLOv3DetectorLearner* class is a wrapper of the SSD detector[[1]](#yolo-1)
8+
The *YOLOv3DetectorLearner* class is a wrapper of the YOLO detector[[1]](#yolo-1)
99
[GluonCV implementation](https://github.com/dmlc/gluon-cv/blob/master/gluoncv/model_zoo/yolo/yolo3.py).
1010
It can be used to perform object detection on images (inference) as well as train new object detection models.
1111

Diff for: src/opendr/control/mobile_manipulation/dependencies.ini

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,16 @@ python=vcstool
1010
[runtime]
1111
# 'python' key expects a value using the Python requirements file format
1212
# https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
13-
python=torch==1.7.1
13+
python=torch==1.9.0
1414
tensorboard
1515
numpy
1616
pyyaml
1717
matplotlib
1818
pyparsing
1919
pillow>=8.3.2
2020
scipy
21-
stable-baselines3>=0.10.0
22-
gym>=0.19.0
21+
stable-baselines3==1.1.0
2322
cloudpickle>=1.5.0
24-
defusedxml
2523
netifaces
2624

2725
opendr=opendr-toolkit-engine

Diff for: src/opendr/control/single_demo_grasp/Makefile

+1-7
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ ifeq ($(MAKECMDGOALS),)
1616
MAKECMDGOALS = release
1717
endif
1818

19-
ifeq ($(OPENDR_DEVICE),gpu)
20-
DETECTRON_WHEEL=https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.7/index.html
21-
else
22-
DETECTRON_WHEEL=https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.7/index.html
23-
endif
24-
2519
.PHONY: release install_compilation_dependencies install_runtime_dependencies
2620

2721
release: install_compilation_dependencies
@@ -31,7 +25,7 @@ install_runtime_dependencies:
3125

3226
install_compilation_dependencies:
3327
@+echo "#"; echo "# * Install Compilation Dependencies for single demonstration grasping *"; echo "#"
34-
@+python3 -m pip install detectron2==0.5 -f \$(DETECTRON_WHEEL)
28+
@+python3 -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
3529
@./install_single_demo_grasp.sh
3630

3731
help:
+7-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
[compilation]
2+
python=torch==1.9.0
3+
torchvision==0.10.0
4+
15
[runtime]
26
# 'python' key expects a value using the Python requirements file format
37
# https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
4-
python=torch==1.7.1
5-
torchvision==0.8.2
8+
python=torch==1.9.0
9+
torchvision==0.10.0
610
matplotlib>=2.2.2
711
imgaug==0.4.0
812
pillow>=8.3.2
913

1014
opendr=opendr-toolkit-engine
1115

12-
post-install=python3 -m pip install detectron2==0.5 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.7/index.html
16+
post-install=python3 -m pip install 'git+https://github.com/facebookresearch/detectron2.git'

0 commit comments

Comments
 (0)