GithubHelp home page GithubHelp logo

robail-yasrab / rootnav-2.0 Goto Github PK

View Code? Open in Web Editor NEW
39.0 5.0 18.0 23.46 MB

Plant Phenotyping APP

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
rootnav python plant phenotyping plant-monitoring plant-growth machine-learning deep-learning artificial-intelligence rootnav2

rootnav-2.0's Introduction

RootNav 2

RootNav 2 is a command line tool for the segmentation and analysis of root architectures in 2D. RootNav 2 is still maintained, please reach out if something doesn't work for you.

Updates 14th April 2024

We are continuing to update RootNav 2 to make using it and training new models as simple as possible. New updates include:

  • New logging features, you can use the --debug flag when training or analysing images to see much more detail on what is happening
  • Code improvements means RootNav 2 runs faster than ever.
  • Updated all code to support the latest versions of PyTorch and other libraries, we have also removed the requirement for a few libraries that were no longer needed.
  • With this update, the installation should be simpler, with only a few libraries needed to install. We have changed the installation guide to better adhere to the typical ways PyTorch are installed.

Installing RootNav 2.0

To install and run rootnav, you will need the following things:

  1. A clone of the code from github
  2. An installation of python
  3. Pytorch and associated libraries
  4. Other packages required by the software

If you wish to train your own models, you will also need:

  1. An Nvidia GPU (otherwise training will be very slow)
  2. Cuda drivers, and pytorch installed with cuda enabled
  3. Additional packages required by the software.

The following instructions assume you have installed python, and have compatible hardware if required. If you are not sure how to install python, we recommend using Anaconda, which can be downloaded here.

Downloading the RootNav 2.0 Code

You will first need to download the code, either as a zip above, or by cloning the git repository (recommended):

git clone https://github.com/robail-yasrab/RootNav-2.0.git

Installing Pytorch

Pytorch is responsible for the deep learning that runs within the Rootnav tool, during both inference and training. Pytorch is updated regularly, and we now recommend installing it following the instructions on the pytorch website.

Other dependencies

The remaining dependencies can be installed using the requirements files in either the inference or training directories. If you're using pip, then the following will work in Linux:

cd RootNav-2.0/inference
pip install -r requirements.txt

You can perform the same thing in the training directory, if you need to train new models using RootNav. Library support in other operating systems is more complex, and as above we recommend using Anaconda. You may find Anaconda is also simplest in Linux as well.

Using the tool

The majority of users will want to run RootNav 2.0 on new images, in which case all the code you need is in the inference folder. You can find more instructions in the inference README.

Training new models

Training code may be found in the training folder. Instructions on training models are given in the training README. If you would like to collaborate on the development of new models for RootNav 2.0, please contact us.

Contact

Rootnav 2 is published in GigaScience. For enquiries please contact [email protected].

References

[1] Yasrab, R., Atkinson, J. A., Wells, D. M., French, A. P., Pridmore, T. P., & Pound, M. P. (2019), RootNav 2.0: Deep learning for automatic navigation of complex plant root architectures, GigaScience, 8(11), giz123.

rootnav-2.0's People

Contributors

mikepound avatar robail-yasrab avatar ynzehiemstra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rootnav-2.0's Issues

Install issues September 2023

Hi @mikepound! I'm transferring our email conversation to Github for future clarity. Here is the start of the email chain:

Our group has been trying to install RootNav-2.0 on PC

Both @ADAS-DaveSkirvin and I tried various different approaches to getting the package installed, and neither had any success. All of our issues were around versioning of the 3rd party packages. In particular, it was torchvision causing the most trouble, with (IIRC) conflict with ??tensorboard. I assume this has resulted from version divergence since the most recent RootNav release?

Dave (cc) tried fairly extensively with conda, and I tried extensively using pip natively (since unfortunately, because ADAS is a commercial entity, conda is a paid license for us, and we’ll need to work around this). I started to expect that this was a conda-forge or pytorch channel versioning issue specific to native pip, but as Dave was having the exact same issues in conda, I don’t think this is the root problem. We’re on PCs, if relevant.

I tried forcing the install versions to those in the requirements.txt with ~=, but this also didn’t work. Neither did trying to roll back further by hand, including rolling back pip itself. I also tried a Python 2 install with your alternate version, hoping that the lack of recent Py2 support might have prevented version divergence, but this also didn’t work.

Does this sound like a known issue to you? Is there some manual workaround we can try? I have fairly extensive experience in Python for large scale research software, so can hopefully answer technical questions you might have. [Happy to open an issue on Github if you’d like me to... and here we are]

Segmentation fault when using external data

Hi all, this tool is really cool!

I have some image data that is similar to image data in your preprint. I do not expect RootNav2 to work on this data out-of-the-box without some transfer learning, but I thought I would try inference on some of my images just to assess how far it could get with the pretrained models. I run into an issue though where I always get the error Segmentation fault: 11. I made sure to resize my images to 1024x1024. I'm not sure where in the process it crashes, maybe it's just due to it not detecting the landmark points properly or something? Here's the full output:

python rootnav.py --model arabidopsis_plate ./test_rootnav_inputs/ ./test_rootnav_outputs/
RootNav 2.0
Cuda is not available, switching to CPU
Loading model...Done
Now Reading test_img.tiff
RootNav-2.0/inference/crf/crf.py:23: RuntimeWarning: divide by zero encountered in log
    unary = -np.log(model_softmax)
Segmentation fault: 11

issue while training RootNav2.0

Command----

kamlesh@kamlesh-Y530-15ICH:~/RootNav-2.0/training$ python3 training.py train

Error---

RUNDIR: runs/rootnav2/65093 Dataset Loading from ./OSR_Root_dataset/ /home/kamlesh/.local/lib/python3.8/site-packages/torch/nn/_reduction.py:42: UserWarning: size_average and reduce args will be deprecated, please use reduction='mean' instead. warnings.warn(warning.format(ret)) Starting training /home/kamlesh/.local/lib/python3.8/site-packages/torch/optim/lr_scheduler.py:138: UserWarning: Detected call of `lr_scheduler.step()` before `optimizer.step()`. In PyTorch 1.1.0 and later, you should call them in the opposite order: `optimizer.step()` before `lr_scheduler.step()`. Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate warnings.warn("Detected call of `lr_scheduler.step()` before `optimizer.step()`. " Killed

@mikepound @robail-yasrab
Please look into the problem and help me solve this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.