- Download and install Anaconda as described in https://docs.anaconda.com/anaconda/install
- Download the object location tool from this link, and decompress the zip.
- Open the terminal in Linux/MacOS. In Windows, open the Anaconda prompt.
- "cd" into the decompressed directory
- Download all files from here and put them in
object-location-whd/object-locator/checkpoints
- Install the dependencies using the environment.yml file:
- For Linux/MacOS, activate the environment with
- For Windows, activate the environment with
- Install the object-locator:
- Install docker-ce as described in https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository
- Install NVIDIA drivers
- Run the following commands
conda env create
source activate object-locator
source activate object-locator
pip install .
Activate the environment:
source activate object-location
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
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
(only for expert users)
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
sudo apt-get purge -y nvidia-docker
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/ubuntu16.04/amd64/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd
docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
You can get more details at https://github.com/NVIDIA/nvidia-docker