From ca755b9fb59762a87f7199b3064a9e8d3b14c1d7 Mon Sep 17 00:00:00 2001 From: Javier Ribera Date: Tue, 8 May 2018 22:51:09 -0400 Subject: [PATCH] Update 'README.md' Former-commit-id: 22631a6b4c0251784007ed7e5be14bcdb42d0ade --- README.md | 106 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 66 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 48e1b47..5b155ef 100644 --- a/README.md +++ b/README.md @@ -1,79 +1,105 @@ -# Table of Contents +# Object location + +## Table of Contents 1. [Using Conda (recommended)](#conda) 1. [Installation](#installation) - 1. [Usage](#usage) + 2. [Usage](#usage) + 1. [Test/evaluate](#test) + 2. [Train](#train) 2. [Using Docker](#docker) ## Using Conda (recommended) -### Installation - -You need to have CUDA 8 installed before proceeding with these installation instructions. This will depend greatly on the specific model of your NVIDIA card and your operating system version. + +### Installation -1. Install Conda (if you already have it you can go to step 2) +
    +
  1. Download and install Anaconda as described in https://docs.anaconda.com/anaconda/install
  2. +
  3. Download the object location tool from this link, and decompress the zip. +
  4. Open the terminal in Linux/MacOS. In Windows, open the Anaconda prompt.
  5. +
  6. "cd" into the decompressed directory
  7. +
  8. Install the dependencies using the environment.yml file:
  9. -curl -L https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o /tmp/miniconda.sh
    -bash /tmp/miniconda.sh -bf
    -rm -rf /tmp/miniconda.sh
    -
    -2. Make sure you have access to Conda with `which conda`. If not, maybe the conda directory is not in your path. Make sure that in your `~/.bash.rc` file you have a line such as -
    -export PATH="~/miniconda3/bin:$PATH"`
    -
    -3. Create the provided conda environment (and also install all the dependencies) with -
    -conda env create -f environment.yml
    +conda env create
     
    -4. Activate it -
    -source activate object-location
    -
    -5. Install the object locator software in this environment +
  10. For Linux/MacOS, activate the environment with
  11. -pip install object_locator-1.1.0-py3-none-any.whl
    +source activate object-locator
     
    -### Usage -1. Activate the environment +
  12. For Windows, activate the environment with
  13. -source activate object-location
    +source activate object-locator
     
    -#### Train (optional) -If you do not want to use one of the provided pretrained models, you can train your own model. Run the following command to get the full help message on how to train, with an explanation of all available training parameters. +
  14. Install the object-locator:
  15. -python -m object-locator.train -h
    +pip install .
     
    -This is a simple example: + +### Usage + +Activate the environment:
    -CUDA_VISIBLE_DEVICES="0,1,3" python -m object-locator.train \
    -                                    --train-dir ~/data/20160613_F54_training_256x256 \
    -                                    --batch-size 32 \
    -                                    --env-name sorghum \
    -                                    --lr 1e-3 \
    -                                    --val-dir ~/data/plant_counts_random_patches/20160613_F54_validation_256x256 \
    -                                    --optim Adam \
    -                                    --save unet_model.ckpt 
    +source activate object-location
     
    + #### Test/evaluate -Use a model/checkpoint to evaluate, i.e, to locate all the objects in a dataset. Run the following command to get the full help message on how to evaluate, with an explanation of all available evbaluation parameters. +To use a pre-trained model/checkpoint. + +Run this to get help (usage instructions):
     python -m object-locator.locate -h
     
    +Example: +
     python -m object-locator.locate \
            --model ~/checkpoints/unet_model.ckpt \
            --dataset ~/data/20160613_F54_testing_256x256 \
            --radius 5 \
            --out results
    +       
     
    -## Using Docker + + + + +#### Train (optional) +If you do not want to use one of the provided pretrained models, you can train your own model. Run the following command to get the full help message on how to train, with an explanation of all available training parameters. +You need to have a NVIDIA card and CUDA 8 installed to train your own model. This depends greatly on the specific model of your NVIDIA card and operating system. + +Run this to get help (usage instructions): +
    +python -m object-locator.train -h
    +
    + +Example: + +
    +python -m object-locator.train \
    +       --train-dir ~/data/20160613_F54_training_256x256 \
    +       --batch-size 32 \
    +       --env-name sorghum \
    +       --lr 1e-3 \
    +       --val-dir ~/data/plant_counts_random_patches/20160613_F54_validation_256x256 \
    +       --optim Adam \
    +       --save unet_model.ckpt
    +
    + + + +## Using Docker + + +(only for expert users) + 1. Install docker-ce as described in https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository 2. Install NVIDIA drivers 3. Run the following commands