Skip to content

Make the model folder adjustable - #149

Open
guiwitz wants to merge 1 commit into
AdaptiveMotorControlLab:mainfrom
guiwitz:flexible-model-path
Open

guiwitz wants to merge 1 commit into
AdaptiveMotorControlLab:mainfrom
guiwitz:flexible-model-path

Conversation

@guiwitz

@guiwitz guiwitz commented Nov 30, 2026

Copy link
Copy Markdown

Hi team CellSeg3D,

after the nice presentation given by @C-Achard at SwissBIAS, I tried to install CellSeg3D on our HPC image analysis platform. After solving the issue mentioned here, I managed to run the software which gave impressive results!

Currently it seems that CellSeg3D always defaults to the installation folder to download models via

PRETRAINED_WEIGHTS_DIR = Path(__file__).parent.resolve() / Path("models/pretrained")

Downloading inside the package itself is usually not recommended and in particular creates problems in the case where the installation folder is somehow locked. This is my case where I provide software on HPC in the form of uneditable containers.

This PR implements a solution where the downloads folder can be set via an environment variable, similarly to what is done for other packages such as pytorch (TORCH_HOME) or spotiflow (SPOTIFLOW_CACHE_DIR).

The current implementation uses CELLSEG3D_WEIGHTS_DIR which can be read inside the software via utils.get_pretrained_weights_dir(). A note has also been added to the documentation.

I'm happy to revise if you think something doesn't fit with the overall package design. Also let me know if I missed a more obvious way to set that path!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant