generated from ashleve/lightning-hydra-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
124 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Installation | ||
|
||
## Set up a virtual environment | ||
|
||
We use [Anaconda](https://anaconda.org/)] to manage and isolate dependencies. | ||
The provided environment setup script also installs [Mamba](https://mamba.readthedocs.io/en/latest/index.html), | ||
which gets on top of conda for faster environment installs. | ||
|
||
```yaml | ||
# clone project | ||
git clone https://github.com/IGNF/lidar-prod-quality-control | ||
cd lidar-prod-quality-control | ||
|
||
# install conda | ||
# see https://www.anaconda.com/products/individual | ||
|
||
# you need to install postgis to request a public database | ||
sudo apt-get install postgis | ||
|
||
# create conda environment | ||
source bash/setup_environment/setup_env.sh | ||
|
||
# activate the virtual env | ||
conda activate lidar_prod | ||
``` | ||
|
||
## Install the app as a python module | ||
|
||
To run the application from anywhere, you can install as a module in a your virtual environment. | ||
|
||
```bash | ||
# activate your env | ||
conda activate lidar_prod | ||
|
||
# install the package from github directly, using production branch | ||
pip install --upgrade https://github.com/IGNF/lidar-prod-quality-control/tarball/prod | ||
|
||
``` | ||
|
||
During development, install in editable mode directly from source with | ||
```bash | ||
pip install --editable . | ||
``` | ||
|
||
Then, refert to the [usage page](./use.md). |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Using the app | ||
|
||
## Run within a docker container | ||
|
||
Up to date docker images (named `lidar_prod_im`) are created via Github integration actions (see [Developer's guide](../guides/development.md)). | ||
|
||
To run the app, use | ||
|
||
```bash | ||
docker run \ | ||
-v {local_src_las_dir}:/inputs/ \ | ||
-v {local_output_dir}:/outputs/ | ||
lidar_prod_im \ | ||
python lidar_prod/run.py \ | ||
paths.src_las=/inputs/{src_las_basename}.las | ||
paths.output_dir=/outputs/ | ||
# + other options... | ||
|
||
``` | ||
|
||
A docker image encapsulating the virtual environment and application sources can also be built using the provided Dockerfile. This Dockerfile is not standalone and should be part of the repository (whose content is copied into the image), on the github reference you want to build from. | ||
|
||
## Run as a python module | ||
To run the module as a module, you will need a source cloud point in LAS format with an additional channel containing predicted building probabilities (`ai_building_proba`) and another one containing predictions entropy (`entropy`). The names of thes channel can be specified via hydra config `config.data_format.las_dimensions`. | ||
|
||
To run using default configurations of the installed module, use | ||
```bash | ||
python -m lidar_prod.run paths.src_las=</path/to/file.las> | ||
``` | ||
|
||
You can specify a different yaml config file with the flags `--config-path` and `--config-name`. You can also override specific parameters. By default, results are saved to a `./outputs/` folder, but this can be overriden with `paths.output_dir` parameter. Refer to [hydra documentation](https://hydra.cc/docs/next/tutorials/basic/your_first_app/config_file/) for the overriding syntax. | ||
|
||
To print default configuration run `python -m lidar_prod.run -h`. For pretty colors, run `python -m lidar_prod.run print_config=true`. | ||
|
||
## Run from source directly | ||
|
||
For developments and debugging, you can run the package directly from python sources instead: | ||
|
||
```bash | ||
# activate an env matching ./bash/setup_env.sh requirements. | ||
conda activate lidar_prod | ||
python lidar_prod/run.py paths.src_las=[/path/to/file.las] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters