Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Idate96 committed Mar 1, 2024
0 parents commit 2f04dc4
Show file tree
Hide file tree
Showing 695 changed files with 153,963 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
max-line-length = 120
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist
ignore = E203, E266, E501, W503
max-complexity = 18
select = B,C,E,F,W,T4
37 changes: 37 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Python package

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.7, 3.8, 3.9, 3.10]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
74 changes: 74 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# These are some examples of commonly ignored file patterns.
# You should customize this list as applicable to your project.
# Learn more about .gitignore:
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore

**/__pycache__/

# Node artifact files
node_modules/
dist/

# Compiled Java class files
*.class

# Compiled Python bytecode
*.py[cod]

# Log files
*.log

# Package files
*.jar

# Maven
target/
dist/

# JetBrains IDE
.idea/

# vscode
.vscode

# Unit test reports
TEST*.xml

# Generated by MacOS
.DS_Store

# Generated by Windows
Thumbs.db

# Applications
*.app
*.exe
*.war

# Large media files
*.mp4
*.tiff
*.avi
*.flv
*.mov
*.wmv

# Trace files and vscode files
*trace.json
*.vscode
# test
panoptic_models/.pytest_cache/
# ignore network weights
panoptic_models/panoptic_models/deeplab2/weights/
panoptic_models/panoptic_models/detr/weights/
panoptic_models/panoptic_models/detr/configs/wandb
panoptic_models/panoptic_models/mask2former/weights/
panoptic_models/datasets/
panoptic_models/outputs/
panoptic_models/logs/
panoptic_models/test
panoptic_models/wandb/
panoptic_models/.pytest_cache
panoptic_models/.etc
panoptic_models/panoptic_models/wandb/
panoptic_models/panoptic_models.egg-info
42 changes: 42 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Contributing to RSL Panoptic

We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:
- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features

## We Develop with Github
We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.

## We Use Github Flow, So All Code Changes Happen Through Pull Requests
Pull requests are the best way to propose changes to the codebase. We actively welcome your pull requests:

1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. Issue that pull request!

## Any contributions you make will be under the MIT Software License
In short, when you submit code changes, your submissions are understood to be under the same [MIT License](LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern.

## Report bugs using Github's [issues](https://github.com/your/repo/issues)
We use GitHub issues to track public bugs. Report a bug by opening a new issue.

**Great Bug Reports** tend to have:
- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can.
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

## Use a Consistent Coding Style
* 4 spaces for indentation rather than tabs
* You can try running `pre-commit install` to automatically check your code style on commit

## License
By contributing, you agree that your contributions will be licensed under its MIT License.
197 changes: 197 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
#=============================================================================
# Copyright (C) 2021, Robotic Systems Lab, ETH Zurich
# All rights reserved.
# http://www.rsl.ethz.ch
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# Authors: Julian Nubert, [email protected]
# Pascal Roth, [email protected]
# Lorenzo Terenzi, [email protected]
#=============================================================================

#==
# Foundation
#==
ARG UBUNTU_VERSION=20.04
ARG CUDA=11.1.1
ARG DRIVER=510
ARG ARCH
FROM nvidia/cuda${ARCH:+-$ARCH}:${CUDA}-cudnn8-devel-ubuntu${UBUNTU_VERSION} as base

# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics,video,compute,utility

# Suppresses interactive calls to APT
ENV DEBIAN_FRONTEND="noninteractive"

# Install graphics drivers
RUN apt update && apt install -y libnvidia-gl-${DRIVER} \
&& rm -rf /var/lib/apt/lists/*

# Needed for string substitution
SHELL ["/bin/bash", "-c"]
ENV TERM=xterm-256color

# ----------------------------------------------------------------------------

#==
# System APT base dependencies and utilities
#==
RUN apt update && apt install -y \
sudo \
lsb-release \
ca-certificates \
apt-utils \
gnupg2 \
locate \
curl \
wget \
git \
vim \
gedit \
tmux \
unzip \
iputils-ping \
net-tools \
htop \
iotop \
iftop \
nmap \
software-properties-common \
build-essential \
gdb \
pkg-config \
cmake \
zsh \
tzdata \
clang-format \
clang-tidy \
xterm \
gnome-terminal \
dialog \
tasksel \
&& rm -rf /var/lib/apt/lists/*

#==
# ROS
#==
# Version
ARG ROS=noetic

RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' \
&& curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - \
&& apt update && apt install -y \
python3-pip \
python3-rosdep \
python3-rosclean \
python3-rosparam \
python3-progressbar \
python3-catkin-tools \
python3-osrf-pycommon \
python3-virtualenvwrapper \
ros-${ROS}-desktop-full \
ros-${ROS}-velodyne-pointcloud \
ros-${ROS}-joy \
ros-${ROS}-grid-map-core \
&& rm -rf /var/lib/apt/lists/* \
&& rosdep init && rosdep update \
&& apt update && apt install -y \
libblas-dev \
xutils-dev \
gfortran \
libf2c2-dev \
libgmock-dev \
libgoogle-glog-dev \
libboost-all-dev \
libeigen3-dev \
libglpk-dev \
liburdfdom-dev \
liboctomap-dev \
libassimp-dev \
python3-catkin-tools \
ros-${ROS}-ompl \
ros-${ROS}-octomap-msgs \
ros-${ROS}-pybind11-catkin \
doxygen-latex \
usbutils \
python3-vcstool \
&& rm -rf /var/lib/apt/lists/* \
&& sudo ln -s /usr/include/eigen3 /usr/local/include/

#==
# RSL Panoptic Segmentation Setup
#==
COPY ./ /home/rsl_panoptic_seg

# Set CUDA paths
ENV CUDA_HOME=/usr/local/cuda-11.1 \
PATH="/usr/local/cuda-11.1/bin:${PATH}" \
LD_LIBRARY_PATH="/usr/local/cuda-11.1/lib64:${LD_LIBRARY_PATH}"

# Create a symbolic link for CUDA (do this before any CUDA detection happens)
RUN ln -s /usr/local/cuda-11.1 /usr/local/cuda

# Display CUDA environment variables (for debugging)
RUN echo "CUDA_HOME=$CUDA_HOME" && \
echo "PATH=$PATH" && \
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"

# Set the repository path
ENV REPO_PATH=/home/rsl_panoptic_seg

# Change to the repository directory
WORKDIR $REPO_PATH

# Install numpy and torch with specified versions
RUN pip3 install numpy==1.22.3
RUN pip3 install torch==1.10.0+cu111 torchvision==0.11.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html

# Install additional required packages
RUN pip3 install pandas tensorflow --upgrade wandb timm scikit-learn

# Install detectron2 if it's required for the project
RUN pip3 install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.10/index.html

# Ensure pytube is installed before attempting to copy files
RUN pip3 install pytube

# Install the panoptic models package
RUN pip3 install -e ./panoptic_models

# Ensure the detectron2 evaluation directory exists before copying files
RUN mkdir -p /usr/local/lib/python3.8/dist-packages/detectron2/evaluation && \
cp ./panoptic_models/panoptic_models/mask2former/third_party/adapted_source_code/panoptic_evaluation.py /usr/local/lib/python3.8/dist-packages/detectron2/evaluation/

# Set permissions for the dist-packages directory
RUN chmod 777 '/usr/local/lib/python3.8/dist-packages/'

ENV FORCE_CUDA="1"
# Build and install custom ops for Mask2Former
WORKDIR $REPO_PATH/panoptic_models/panoptic_models/mask2former/third_party/Mask2Former/mask2former/modeling/pixel_decoder/ops
RUN python3 setup.py build install

# Return to the repository path
WORKDIR $REPO_PATH

# ----------------------------------------------------------------------------

#==
# Cleanup
#==
RUN apt update && apt upgrade -y

# ----------------------------------------------------------------------------

#==
# Execution
#==
COPY bin/entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD []

# EOF
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Robotics Systems Laboratory

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 2f04dc4

Please sign in to comment.