Upload README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,68 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EMAG2 completion
|
| 2 |
+
|
| 3 |
+
**Recovering Missing Regions of Earth Magnetic Anomaly Grid data (EMAG2) Using RePaint based on Diffusion Model**
|
| 4 |
+
|
| 5 |
+
[](https://doi.org/10.1016/j.bdes.2025.100004)
|
| 6 |
+
[](https://github.com/fangyuanmao/EMAG2-Completion)
|
| 7 |
+
[](https://huggingface.co/datasets/FerrisMao/EMAG2-completion)
|
| 8 |
+
|
| 9 |
+
## Set up
|
| 10 |
+
|
| 11 |
+
### 1. Environment
|
| 12 |
+
|
| 13 |
+
```
|
| 14 |
+
pip install numpy torch blobfile tqdm pyYaml pillow pandas # e.g. torch 1.7.1+cu110.
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
### 2. Download pretrained model and EMAG2 data.
|
| 18 |
+
|
| 19 |
+
| Name | Note |
|
| 20 |
+
| :-----------------: | :------------------------------------------: |
|
| 21 |
+
| [Completion results(OneDrive)](https://1drv.ms/f/c/2e4d56a3d20d5c20/EmXvznPFpKRMu9dRpMWMkf8BtLq1n7uEUsy8QO8FBjaR1Q?e=UoTLF8) | Our completion results including csv and pdf |
|
| 22 |
+
| [Completion results(HuggingFace)](https://huggingface.co/datasets/FerrisMao/EMAG2-completion) | FerrisMao/EMAG2-completion |
|
| 23 |
+
| [Public EMAG2 data](https://www.ncei.noaa.gov/emag-survey-page) | EMAG2 data |
|
| 24 |
+
| [Pretrained model](https://1drv.ms/f/c/2e4d56a3d20d5c20/Etyk9PQRhqlEmF1s1v8L6rQBURaacy-HfRvMCk7QxZBhrA?e=pOIINp) | Pretrained guided-diffusion model |
|
| 25 |
+
|
| 26 |
+
Place the pretrained model under `./pretrain` and original EMAG2 data under `./EMAG2`.
|
| 27 |
+
|
| 28 |
+
### 3. Run example
|
| 29 |
+
|
| 30 |
+
We prepare an easy test for quick evaluation. The input images and masks are in `./data`.
|
| 31 |
+
|
| 32 |
+
```
|
| 33 |
+
bash shell/easy_test.sh
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
## Completion method
|
| 37 |
+
|
| 38 |
+
### 1. Step 0: Data preprocess
|
| 39 |
+
|
| 40 |
+
Download EMAG2_V3 and place it in `./EMAG2`. Run the below command, you can preprocess the EMAG2_V3.
|
| 41 |
+
|
| 42 |
+
```shell
|
| 43 |
+
python scripts/preprocess.py
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
### 2. Step 1: Global completion
|
| 47 |
+
|
| 48 |
+
```shell
|
| 49 |
+
bash shell/step1.sh
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
### 3. Step 2: Local completion
|
| 53 |
+
|
| 54 |
+
```shell
|
| 55 |
+
bash shell/step2.sh
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## FAQ
|
| 59 |
+
|
| 60 |
+
**How to apply it for other datasets?**
|
| 61 |
+
|
| 62 |
+
If you want train new completion model on a new dataset, it is recommended to follow [guided-diffusion](https://github.com/openai/guided-diffusion) repository to obtain guided-diffusion model, then follow our completion method.
|
| 63 |
+
|
| 64 |
+
## Acknowledgements
|
| 65 |
+
|
| 66 |
+
Our code is built upon [RePaint](https://github.com/andreas128/RePaint) and [guided-diffuion](https://github.com/openai/guided-diffusion.git). We thank the authors for their excellent work.
|
| 67 |
+
|
| 68 |
+
If you have any question, feel free to contact fymao@zju.edu.cn or fangyuanmaocs@gmail.com .
|