Classification of agricultural crops on UAV images
This repository provides codes for training and testing crop classification algorithms on UAV optical images. The following architectures of convolutional neural networks are presented in the repository:
- MobilenetV2
NOTE: Installation instructions are provided for Linux.
Install the virtual environment in the project:
pip3 install -r requirements.txtYou can also run the project in Docker container. Pull docker image from repository:
docker pull nikkotov98/kotov_sar:devCreate a docker container based on the downloaded image:
docker run -it --gpus all -v /local_data_root/:/docker_data_root/ /local_code_root/:/docker_code_root/ --name container_name nikkotov98/kotov_sar:devYou can also use the official image from Nvidia:
docker pull nvcr.io/nvidia/pytorch:21.06-py3Start training the corresponding algorithm with the following command (optionally, the output of the terminal is written to the log file):
python3 train_xxx.py &> log_name.logStart testing the corresponding algorithm on the saved scales with the following command:
python3 test.pyFor prepare dataset for training/testing neural network, your data folder must be introduce in the following view:
Datafolder
├── class_name_1
├── class_name_2
├── class_name_3
...
Then run extract_patches.py. There are you should changed parameters ROOT_DIR, DATASET_DIR, PATCHES_DIR, PATCH_SIZE, STEP to your parameters:
python3 extract_patches.py