Spaces:
Running
Running
title: Opdmulti Demo | |
emoji: π | |
colorFrom: gray | |
colorTo: red | |
sdk: docker | |
app_port: 7860 | |
pinned: false | |
license: mit | |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference | |
## Installation | |
## Requirements | |
For the docker build, you will just need docker in order to build and run the container, else you will need | |
* python 3.10 | |
* git | |
* libosmesa6-dev (for open3d headless rendering) | |
### Docker (preferred) | |
To build the docker container, run | |
``` | |
docker build -f Dockerfile -t opdmulti-demo . | |
``` | |
### Local | |
To setup the environment, run the following (recommended in a virtual environment): | |
``` | |
# install base requirements | |
python3.10 -m pip install -r requirements.txt | |
# install detectron2 (must be done after some of the libraries in requirements.txt) | |
python3.10 -m pip install git+https://github.com/facebookresearch/detectron2.git@fc9c33b1f6e5d4c37bbb46dde19af41afc1ddb2a | |
# build library for model | |
cd mask2former/modeling/pixel_decoder/ops | |
python setup.py build install | |
# INSTALL OPEN3D | |
# -------------- | |
# Option A: running locally only | |
pip install open3d==0.17.0 | |
# Option B: running over ssh connection / headless environment | |
# in a separate folder | |
git clone https://github.com/isl-org/Open3D.git | |
cd Open3D/ | |
mkdir build && cd build | |
cmake -DENABLE_HEADLESS_RENDERING=ON -DBUILD_GUI=OFF -DBUILD_WEBRTC=OFF -DUSE_SYSTEM_GLEW=OFF -DUSE_SYSTEM_GLFW=OFF .. | |
make -j$(nproc) | |
make install-pip-package | |
# to test custom build | |
cd ../examples/python/visualization/ | |
python headless_rendering.py | |
``` | |
## Usage | |
### Docker (preferred) | |
To run the docker container, execute | |
``` | |
docker run -d --network host -t opdmulti-demo | |
``` | |
If you want to see the output of the container or interact with it, | |
* use `-it` to run in interactive mode, and remove the `-d` option | |
* add `bash` to the end to open into a console rather than running the app directly | |
### Local | |
To startup the application locally, run | |
``` | |
gradio app.py | |
``` | |
You can view the app on the specified port (usually 7860). To run over an ssh connection, setup port forwarding using | |
`-L 7860:localhost:7860` when you create your ssh connection. Note that you will need to install Open3D in headless | |
rendering for this to work, as described above. | |