Skip to content

Commit

Permalink
Merge pull request #170 from tibuch/plantseg_home
Browse files Browse the repository at this point in the history
Add option to set home_path via PLANTSEG_HOME env-variable.
  • Loading branch information
lorenzocerrone authored Nov 22, 2023
2 parents ef84986 + 54d18c2 commit cd37cc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ Selecting a given network name (either in the config file or GUI) will download
directory.
Detailed description of network training can be found in our [paper](#citation).

The PlantSeg home directory can be configured with the `PLANTSEG_HOME` environment variable.
```bash
export PLANTSEG_HOME="/path/to/plantseg/home"
```

## Training on New Data
For training new models we rely on the [pytorch-3dunet](https://github.com/wolny/pytorch-3dunet).
A similar configuration file can be used for training on new data and all the instructions can be found in the repo.
Expand Down
5 changes: 4 additions & 1 deletion plantseg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
plantseg_global_path = Path(__file__).parent.absolute()

# Create configs directory at startup
home_path = os.path.expanduser("~")
if 'PLANTSEG_HOME' in os.environ:
home_path = os.environ['PLANTSEG_HOME']
else:
home_path = os.path.expanduser("~")
PLANTSEG_MODELS_DIR = ".plantseg_models"

configs_path = os.path.join(home_path, PLANTSEG_MODELS_DIR, "configs")
Expand Down

0 comments on commit cd37cc6

Please sign in to comment.