csaybar commited on
Commit
4f2f163
·
verified ·
1 Parent(s): b01e57b

Update opensr_model/run.py

Browse files
Files changed (1) hide show
  1. opensr_model/run.py +10 -3
opensr_model/run.py CHANGED
@@ -1,9 +1,10 @@
 
1
  import opensr_test
2
  import matplotlib.pyplot as plt
3
- from utils import create_opensr_model, run_opensr_model
4
 
5
  # Load the model
6
- model = create_opensr_model(device="cpu")
7
 
8
  # Load the dataset
9
  dataset = opensr_test.load("naip")
@@ -14,7 +15,7 @@ results = run_opensr_model(
14
  model=model,
15
  lr=lr_dataset[7],
16
  hr=hr_dataset[7],
17
- device="cpu"
18
  )
19
 
20
  # Display the results
@@ -28,3 +29,9 @@ ax[1].axis("off")
28
  ax[2].imshow(results["hr"].transpose(1, 2, 0) / 3000)
29
  ax[2].set_title("HR")
30
  plt.show()
 
 
 
 
 
 
 
1
+ import benchmark
2
  import opensr_test
3
  import matplotlib.pyplot as plt
4
+ from opensrmodel.utils import create_opensr_model, run_opensr_model
5
 
6
  # Load the model
7
+ model = create_opensr_model(device="cuda")
8
 
9
  # Load the dataset
10
  dataset = opensr_test.load("naip")
 
15
  model=model,
16
  lr=lr_dataset[7],
17
  hr=hr_dataset[7],
18
+ device="cuda"
19
  )
20
 
21
  # Display the results
 
29
  ax[2].imshow(results["hr"].transpose(1, 2, 0) / 3000)
30
  ax[2].set_title("HR")
31
  plt.show()
32
+
33
+
34
+ # Run the experiment
35
+ # benchmark.create_geotiff(model, run_opensr_model, "all", "opensrmodel/", device="cuda")
36
+ # benchmark.run(["naip"])
37
+ # benchmark.plot(["naip"])