Mask3D icon indicating copy to clipboard operation
Mask3D copied to clipboard

Windows support

Open Wavelet303 opened this issue 2 years ago • 4 comments

First of all, congratulations for your great work. I currently use softgroup to perform instance detection and want to replace it with your work. I only need to make the inference with a 3d scene obtained by Bundlefusion. I am a windows user and have installed all the python packages with no problem. The only problem I have found is the use of MinkowskiEngine since it is not compatible with Windows. My question is if you know if I can make the Mask3D method compatible with Windows, taking into account that I am only going to perform the inference of the model and that the MinkowskiEngine only works on Linux. Thanks for your attention

Wavelet303 avatar Oct 05 '22 10:10 Wavelet303

@Wavelet303 You'd have to use a docker container. I've written a sample Dockerfile which allows Mask3D to work independently of the host OS. You should try to do that as well: Here's an excerpt from the dockerfile that works:

FROM nvidia/cuda:11.3.1-devel-ubuntu20.04
SHELL ["/bin/bash", "-c"]

ARG DEBIAN_FRONTEND=noninteractive
ENV PATH="/root/miniconda3/bin:${PATH}"
ARG PATH="/root/miniconda3/bin:${PATH}"
ENV TORCH_CUDA_ARCH_LIST="3.5;5.0;6.0;6.1;7.0;7.5;8.0;8.6+PTX"

RUN apt-get update && apt-get -y upgrade \
  && apt-get install -y --no-install-recommends \
    git \
    wget unzip \
    g++ \
    ca-certificates \
    environment-modules \
    curl \
    && rm -rf /var/lib/apt/lists/* && \
    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
    && mkdir /root/.conda \
    && bash Miniconda3-latest-Linux-x86_64.sh -b \
    && rm -f Miniconda3-latest-Linux-x86_64.sh \
    && echo "Running $(conda --version)" && \
    conda init bash && \
    . /root/.bashrc && \
    conda update conda && \
    conda config --set channel_priority flexible && \
    source /root/miniconda3/etc/profile.d/conda.sh

RUN conda install -y python=3.9

After that, you can just add more RUN commands with every step of the installation, as described in readme. The resulting container will be able to run everywhere, with docker.

tornikeo avatar Oct 05 '22 12:10 tornikeo

Thanks a lot @tornikeo for your detailed answer. I will try to test the docker, and if it doesn't work I will do it via WSL2.

Wavelet303 avatar Oct 10 '22 07:10 Wavelet303

@tornikeo, I've just reproduced those steps and it seems that everything went successful! Let me write here my full experience in Linux in case someone considers it useful:

  1. I created the Dockerfile with all the content that gave @tornikeo. I did not append anything else.
  2. I built an image called "mask3d_image" with this Dockerfile source by doing: docker build -t mask3d_image . (Note_ Execute this line in the actual path of the Dockerfile, logically).
  3. I received the following error:

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/l/less/less_551-1ubuntu0.1_amd64.deb Temporary failure resolving 'archive.ubuntu.com' E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

  1. The error can be solved by previously doing sudo apt-get update as suggested. In case of trying this in an non-root permissions server should be different.
  2. Again, I made docker build -t mask3d_image . and waited.
  3. Once the image is created we can check its ID, name, etc by doing docker images.
  4. Then, I created a container associated with this image by directly running this image interactively as a container: docker run -i -t ID_of_the_image /bin/bash.
  5. Inside the container, I created the following directory "/home/lino/Documents/Mask3D", since we do not have any file from the host filesystem and I want to copy all the Mask3D git repository files in that destination folder within the container.
  6. I exited this container by typing Ctrl+D (or just "exit") and, then, I made docker ps -a in order to see the name and ID of the container. In my case was named as "reverent_clarke".
  7. In the terminal, I navigated to the folder where the Mask3D git repository was cloned and I copied it in the container: docker cp Mask3D/. reverent_clarke:/home/lino/Documents/Mask3D.
  8. As the container was stopped, I initialized it again in the background by doing docker start ID_container followed by docker attach ID_container for rerunning this container in interactive mode.
  9. Now, inside of the container, I could finish the installation of the rest of the dependencies by following the official guidelines with slightly changes:

conda create --name=mask3d python=3.10.6 conda activate mask3d conda update -n base -c defaults conda conda install openblas-devel -c anaconda pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu116 pip install torch-scatter -f https://data.pyg.org/whl/torch-1.12.1+cu116.html pip install ninja==1.10.2.3 pip install pytorch-lightning fire imageio tqdm wandb python-dotenv pyviz3d scipy plyfile scikit-learn trimesh loguru albumentations volumentations pip install antlr4-python3-runtime==4.8 pip install black==21.4b2 pip install omegaconf==2.0.6 hydra-core==1.0.5 --no-deps pip install 'git+https://github.com/facebookresearch/detectron2.git@710e7795d0eeadf9def0e7ef957eea13532e34cf' --no-deps cd /home/lino/Documents/Mask3D cd third_party/pointnet2 && python setup.py install

LinoComesana avatar Mar 09 '23 11:03 LinoComesana

First of all, congratulations for your great work. I currently use softgroup to perform instance detection and want to replace it with your work. I only need to make the inference with a 3d scene obtained by Bundlefusion. I am a windows user and have installed all the python packages with no problem. The only problem I have found is the use of MinkowskiEngine since it is not compatible with Windows. My question is if you know if I can make the Mask3D method compatible with Windows, taking into account that I am only going to perform the inference of the model and that the MinkowskiEngine only works on Linux. Thanks for your attention

Have you successfully performed instance segmentation through Softgroup? For Mask3D and Softgroup, which can be used for own 3D PC instance segmentation more conveniently?

mliu285 avatar Dec 20 '23 08:12 mliu285