Vision transformer - RVSA for object detection
Table of Contents
Features
Load object detection model - remote sensing image.
- Visualize
Getting Started
Below is the list of dependencies and steps to use the repository
Prerequisites
List any software or libraries that are required to run your project.
- Python 3
- mmcv
- mmrotate
- torch
- mmdetection
Installation
Step-by-step instructions on how to install your project.
- Install environment:
- Install torch
- CPU:
pip install -q torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cpu
pip install -q mmcv==2.0.1 -f https://download.openmmlab.com/mmcv/dist/cpu/torch2.0/index.html
- GPU:
pip install -q torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2
pip install -q mmcv==2.0.1 -f https://download.openmmlab.com/mmcv/dist/cu117/torch2.0/index.html
- Install other dependencies:
pip install -q "mmdet>=3.0.0rc6,<3.1.0"
git clone https://github.com/open-mmlab/mmrotate -b 1.x
cd mmrotate
pip install -q -e .
cd ..
git clone https://github.com/ViTAE-Transformer/MTP
cp -r ./MTP/RS_Tasks_Finetune/Rotated_Detection/mmrotate1.x/mmrotate/* ./mmrotate/mmrotate
git clone https://huggingface.co/datasets/KhangTruong/NWPU-Caption
tar -xf NWPU-Caption/02_NWPU_RESISC45.tar
tar -xf NWPU-Caption/02_NWPU_caption.tar
mv 02_NWPU_RESISC45 data
mv 02_NWPU_caption data
python install.py --root .
- Change the directory to mmrotate, which is inside the current working directory
cd mmrotate
- Run the inference
python ../extract_feature.py -n ../data/airplane/airplane_002.jpg
- It will produce an image in vis_data, which is the labelled image.