TreeRotate / readme.md
KhangTruong's picture
Update weight
d7c3e62
# Vision transformer - RVSA for object detection
## Table of Contents
- [Features](#Features)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
## 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.
1. 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 .
```
2. Change the directory to *mmrotate*, which is inside the current working directory
```
cd mmrotate
```
3. Run the inference
```
python ../extract_feature.py -n ../data/airplane/airplane_002.jpg
```
4. It will produce an image in *vis_data*, which is the labelled image.