File size: 1,864 Bytes
d7c3e62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77

# 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.