Run this project in a Linux environment for most compatability
If on Windows, just run this in WSL2. Its not worth it trying to get tensorflow-gpu working.
If you want to train using a GPU, you must have a CUDA supported GPU and install the correct version of CUDA and cudnn installed before running the installation steps.
- Python
- Pip
- Create a python virtual environment with the command
python3 -m venv .venv - Activate virtual environment with the command
source .venv/bin/activate - Run
install.sh
- Download your dataset
- Preprocess your dataset, currently only provides a script to preprocess the uavid dataset (available at https://uavid.nl/)
Run the python scriptpreprocess_uavid_data.pyin thedata_scriptsdirectory through command line with argument--dataset_dirdataset_dir should be the folder containing the subfoldersuavid_train,uavid_val,uavid_test - Train your model
3.1 Explanation
Each model architecture has a folder of the same name (IE: the autoencoder model would be in the autoencoder directory)
3.2 Modify Hyperparameters In the model architecture folder, modify thehyperparameters.jsonfile
3.3 Run Model Training In the model architecture folder, run the python filetrain.py
Models are saved to a file with the name <architecture>.keras
In order to run the models, you must pass it the custom objects that are passed to it as in file data_script/inference.py.
Inferencing your model can be done by running the data_scripts/inference.py script through the commmand line
The following are the command line arguments for the script
--model_path (path to your model) REQUIRED
--data_dir (directory where your data is)