BiliSakura commited on
Commit
d6c4f12
·
verified ·
1 Parent(s): 844f2b9

Add files using upload-large-folder tool

Browse files
Files changed (1) hide show
  1. README.md +11 -4
README.md CHANGED
@@ -10,6 +10,8 @@ tags:
10
  - remote-sensing
11
  ---
12
 
 
 
13
  # CUT-OpenEarthMap-SAR
14
 
15
  CUT (Contrastive Unpaired Translation) models for SAR ↔ optical image translation. Trained on OpenEarthMap data with anti-aliased ResNet generators.
@@ -27,17 +29,22 @@ CUT (Contrastive Unpaired Translation) models for SAR ↔ optical image translat
27
 
28
  ## Usage
29
 
30
- Use with [pytorch-image-translation-models](https://github.com/Bili-Sakura/pytorch-image-translation-models):
31
 
32
  ```python
 
 
33
  from examples.community.openearthmap_sar import load_openearthmap_sar_pipeline
34
 
35
  pipeline = load_openearthmap_sar_pipeline(
36
- checkpoint_dir="BiliSakura/CUT-OpenEarthMap-SAR", # or local path
37
- model_name="sar2opt",
38
  device="cuda",
39
  )
40
- output = pipeline(source_image=pil_image, output_type="pil")
 
 
 
41
  ```
42
 
43
  **CLI:**
 
10
  - remote-sensing
11
  ---
12
 
13
+ > [!WARNING] we do not have a full checkpoint conversion validation, if you encounter pipeline loading failure and unsidered output, please contact me via bili_sakura@zju.edu.cn
14
+
15
  # CUT-OpenEarthMap-SAR
16
 
17
  CUT (Contrastive Unpaired Translation) models for SAR ↔ optical image translation. Trained on OpenEarthMap data with anti-aliased ResNet generators.
 
29
 
30
  ## Usage
31
 
32
+ Use with [pytorch-image-translation-models](https://github.com/Bili-Sakura/pytorch-image-translation-models) and the `openearthmap_sar` community pipeline:
33
 
34
  ```python
35
+ from PIL import Image
36
+
37
  from examples.community.openearthmap_sar import load_openearthmap_sar_pipeline
38
 
39
  pipeline = load_openearthmap_sar_pipeline(
40
+ checkpoint_dir="/path/to/CUT-OpenEarthMap-SAR",
41
+ model_name="sar2opt", # choose one: opt2sar, sar2opt, seman2opt, seman2opt_pesudo, seman2sar, seman2sar_pesudo
42
  device="cuda",
43
  )
44
+
45
+ source = Image.open("/path/to/sar.png").convert("RGB")
46
+ output = pipeline(source_image=source, output_type="pil")
47
+ output.images[0].save("cut_sar2opt.png")
48
  ```
49
 
50
  **CLI:**