UAVidToolKit provides basic tools for easier usage of the UAVid dataset. Including label conversion, label visualization, performance evaluation and image label path pair txtfile preparation.
Download the toolkit into the dataset folder as follows,
cd <UAVid dataset folder>
git clone https://github.com/YeLyuUT/UAVidToolKit.git
cd UAVidToolKit
python setup.py build_ext --inplace
cd ..
Rename training, validation and testing subfolders into 'train', 'valid' and 'test'. Or create symlink with cmd,
ln -s <train dir> train
ln -s <valid dir> valid
ln -s <test dir> test
The data structure should be like:
\UAVidDataset
\train
\seq
...
\valid
\seq
...
\test
\seq
...
\UAVidToolKit
In the UAVid dataset folder, apply commands as follows:
python UAVidToolKit/prepareTrainIdFiles.py -s <src folder> -t <dst folder>
e.g. python UAVidToolKit/prepareTrainIdFiles.py -s valid/ -t tooltest/
python UAVidToolKit/convertTrainIdFiles2Color.py -s <src folder> -t <dst folder> -f <sub folder name>
e.g. python UAVidToolKit/convertTrainIdFiles2Color.py -s tooltest/ -t tooltest/ -f 'color'
python UAVidToolKit/blendImageAndLabel.py -i <image folder> -l <label folder> -o <output folder> -id <image subfolder name> -ld <label subfolder name> -od <output subfolder name>
e.g. python UAVidToolKit/blendImageAndLabel.py -i valid/ -l tooltest/ -o tooltest/ -id Images -ld color -od blend
python UAVidToolKit/evaluate.py -gt <ground truth folder> -p <prediction folder> -v
If add '-v', visualize mIoU and confusion matrix results with figures.
e.g. python UAVidToolKit/evaluate.py -gt valid -p pred_valid -v
python UAVidToolKit/writeImageLabelPathPairsToTxtFile.py -d <dataset folder> -t -v
If add '-t', add training set to txt.
If add '-v', add valid set to txt.
e.g. python UAVidToolKit/writeImageLabelPathPairsToTxtFile.py -d ./ -t -v
If you have any question or new feature suggestion, please create an issue to let me know.