Docker container for ROMI plantinterpreterLink
Important
An existing local database directory is required, it will be mounted at container startup. To see how to create a local database directory, look here.
Use pre-built docker imageLink
Assuming you have a valid ROMI database directory under /data/ROMI/DB
, you can easily download and start the pre-built roboticsmicrofarms/plant-3d-vision
docker image with:
export ROMI_DB=/data/ROMI/DB
docker run --runtime=nvidia --gpus all \
--env PYOPENCL_CTX='0' \
-v $ROMI_DB:/myapp/db \
-it roboticsmicrofarms/plant-3d-vision:latest
This should start the latest pre-built roboticsmicrofarms/plant-3d-vision
docker image in interactive mode.
The database location inside the docker container is /myapp/db
.
Note
-v $ROMI_DB:/myapp/db
performs a bind mount to enable access to the local database by the docker image.
See the official documentation.
Build docker imageLink
We provide a convenience bash script to ease the build of roboticsmicrofarms/plant-3d-vision
docker image.
You can choose to use this script OR to "manually" call the docker build
command.
Provided convenience build.sh
scriptLink
To build the image with the provided build script, from the root directory:
./docker/build.sh
You can also pass some options, use ./docker/build.sh -h
to get more details about usage, options and default values.
Tips
To be sure to always pull the latest parent image, you may add the --pull
option!
Manually call the docker build
commandLink
To build the image, from the root directory:
export VTAG="latest"
docker build -t roboticsmicrofarms/plant-3d-vision:$VTAG .
Publish docker imageLink
Push it on docker hub:
docker push roboticsmicrofarms/plantdb:$VTAG
This requires a valid account & token on dockerhub!
UsageLink
RequirementsLink
To run it, you need to have a valid local ROMI database, look here for instructions and here for an example database.
Starting the plant-3d-vision
docker imageLink
Provided run.sh
scriptLink
To start the container, in interactive mode, with the provided run script in plant3dvision/docker
, use:
./run.sh
You can also pass some options, use ./run.sh -h
to get more details about usage and options, notably to mount a local romi database.
NVIDIA GPU testLink
To make sure the started container will be able to access the host GPU, use:
./run.sh --gpu_test
Pipelines testsLink
To performs test reconstructions, you have several possibilities:
- test the geometric pipeline:
./run.sh --geom_pipeline_test
- test the machine learning pipeline:
./run.sh --ml_pipeline_test
- test both pipelines:
./run.sh --pipeline_test
Note
This use test data & test models (for ML) provided with plant3dvision
in plant3dvision/tests/testdata
.
ManuallyLink
Assuming you have a valid ROMI database directory under /data/ROMI/DB
, you can start the roboticsmicrofarms/plant-3d-vision
docker image with:
export ROMI_DB=/data/ROMI/DB
docker run --runtime=nvidia --gpus all \
--env PYOPENCL_CTX='0' \
-v $ROMI_DB:/myapp/db \
-it roboticsmicrofarms/plant-3d-vision:$VTAG bash
This should start the built roboticsmicrofarms/plant-3d-vision
docker image in interactive mode.
The database location inside the docker container is ~/db
.
Note that:
- you are using the docker image
roboticsmicrofarms/plant-3d-vision:$VTAG
- you mount the host directory
$ROMI_DB
"inside" the running container in the~/db
directory - you activate all GPUs within the container with
--gpus all
- declaring the environment variable
PYOPENCL_CTX='0'
select the first CUDA GPU capable -it
&bash
returns an interactive bash shell
You may want to name the running container (with --name <my_name>
) if you "demonize" it (with -d
).
Executing a ROMI taskLink
Once you are inside the running docker container, you may call the ROMI tasks.
romi_run_task AnglesAndInternodes db/<my_scan_000>/ --config plant3dvision/configs/original_pipe_0.toml
Note
You may have to source the .profile
file before calling romi_run_task
.
You can give a command to execute at container start-up using the -c, --cmd
option.
For example:
export ROMI_DB=/data/ROMI/DB
./run.sh -p $ROMI_DB -u scanner -c "source .profile && romi_run_task AnglesAndInternodes db/<my_scan_000>/ --config plant3dvision/configs/original_pipe_0.toml"
Important
source .profile
is important to add .local/bin/
to the $PATH
environment variable.
If you don't do this, you might not be able to access the romi_run_task
binary from bash in the docker container.