hyperbench 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hyperbench-0.1.0/LICENSE.txt +21 -0
- hyperbench-0.1.0/PKG-INFO +171 -0
- hyperbench-0.1.0/README.md +137 -0
- hyperbench-0.1.0/pyproject.toml +74 -0
- hyperbench-0.1.0/setup.cfg +4 -0
- hyperbench-0.1.0/src/hyperbench/__about__.py +7 -0
- hyperbench-0.1.0/src/hyperbench/__init__.py +157 -0
- hyperbench-0.1.0/src/hyperbench/adapters/__init__.py +19 -0
- hyperbench-0.1.0/src/hyperbench/adapters/base.py +178 -0
- hyperbench-0.1.0/src/hyperbench/adapters/callable.py +62 -0
- hyperbench-0.1.0/src/hyperbench/adapters/pipeline.py +192 -0
- hyperbench-0.1.0/src/hyperbench/adapters/tensorflow.py +67 -0
- hyperbench-0.1.0/src/hyperbench/adapters/torch.py +108 -0
- hyperbench-0.1.0/src/hyperbench/benchmark/__init__.py +18 -0
- hyperbench-0.1.0/src/hyperbench/benchmark/case.py +121 -0
- hyperbench-0.1.0/src/hyperbench/benchmark/generator.py +122 -0
- hyperbench-0.1.0/src/hyperbench/benchmark/results.py +127 -0
- hyperbench-0.1.0/src/hyperbench/benchmark/runner.py +392 -0
- hyperbench-0.1.0/src/hyperbench/cli.py +209 -0
- hyperbench-0.1.0/src/hyperbench/config.py +122 -0
- hyperbench-0.1.0/src/hyperbench/degradations/__init__.py +65 -0
- hyperbench-0.1.0/src/hyperbench/degradations/preprocessing.py +111 -0
- hyperbench-0.1.0/src/hyperbench/degradations/psf.py +233 -0
- hyperbench-0.1.0/src/hyperbench/degradations/spatial.py +100 -0
- hyperbench-0.1.0/src/hyperbench/degradations/spectral.py +97 -0
- hyperbench-0.1.0/src/hyperbench/degradations/srf.py +189 -0
- hyperbench-0.1.0/src/hyperbench/exceptions.py +53 -0
- hyperbench-0.1.0/src/hyperbench/io/__init__.py +15 -0
- hyperbench-0.1.0/src/hyperbench/io/loaders.py +70 -0
- hyperbench-0.1.0/src/hyperbench/io/matlab.py +97 -0
- hyperbench-0.1.0/src/hyperbench/metrics/__init__.py +27 -0
- hyperbench-0.1.0/src/hyperbench/metrics/core.py +181 -0
- hyperbench-0.1.0/src/hyperbench/metrics/hyperspectral.py +67 -0
- hyperbench-0.1.0/src/hyperbench/types.py +24 -0
- hyperbench-0.1.0/src/hyperbench/utils/__init__.py +90 -0
- hyperbench-0.1.0/src/hyperbench/utils/frameworks.py +314 -0
- hyperbench-0.1.0/src/hyperbench/utils/logging.py +152 -0
- hyperbench-0.1.0/src/hyperbench/utils/random.py +92 -0
- hyperbench-0.1.0/src/hyperbench/utils/validation.py +213 -0
- hyperbench-0.1.0/src/hyperbench/utils/visualization.py +255 -0
- hyperbench-0.1.0/src/hyperbench.egg-info/PKG-INFO +171 -0
- hyperbench-0.1.0/src/hyperbench.egg-info/SOURCES.txt +44 -0
- hyperbench-0.1.0/src/hyperbench.egg-info/dependency_links.txt +1 -0
- hyperbench-0.1.0/src/hyperbench.egg-info/entry_points.txt +2 -0
- hyperbench-0.1.0/src/hyperbench.egg-info/requires.txt +16 -0
- hyperbench-0.1.0/src/hyperbench.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ritik Shah
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hyperbench
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Synthetic benchmarking for hyperspectral super-resolution methods
|
|
5
|
+
Author: HyperBench Authors
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: hyperspectral imaging,super-resolution,remote sensing,benchmarking,image fusion
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Science/Research
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE.txt
|
|
18
|
+
Requires-Dist: numpy==1.26.4
|
|
19
|
+
Requires-Dist: scipy>=1.10
|
|
20
|
+
Requires-Dist: opencv-python==4.9.0.80
|
|
21
|
+
Requires-Dist: matplotlib>=3.7
|
|
22
|
+
Requires-Dist: sewar>=0.4.6
|
|
23
|
+
Requires-Dist: spectral>=0.23
|
|
24
|
+
Requires-Dist: ipykernel>=6.29
|
|
25
|
+
Requires-Dist: jupyterlab>=4.0
|
|
26
|
+
Requires-Dist: pyyaml>=6.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-cov>=4.1; extra == "dev"
|
|
30
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
31
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
32
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# HyperBench
|
|
36
|
+
|
|
37
|
+
**HyperBench** is a synthetic benchmarking framework for fusion based hyperspectral
|
|
38
|
+
super-resolution (HSR) methods. It provides a standardized, reproducible
|
|
39
|
+
pipeline for evaluating models using controlled degradations, consistent
|
|
40
|
+
metrics, and structured experiment outputs.
|
|
41
|
+
|
|
42
|
+
HyperBench is designed as an **inference-time evaluation tool**. It does
|
|
43
|
+
not perform model training. Instead, it enables users to test
|
|
44
|
+
already-trained models under a wide range of synthetic scenarios.
|
|
45
|
+
|
|
46
|
+
**Project Home: https://github.com/ritikgshah/HyperBench**. Please visit the github repository for exact implementation details and documentation. This PyPi project is solely meant to serve as the distribution method.
|
|
47
|
+
|
|
48
|
+
------------------------------------------------------------------------
|
|
49
|
+
|
|
50
|
+
## Key Features
|
|
51
|
+
|
|
52
|
+
### Synthetic Degradation Pipeline
|
|
53
|
+
|
|
54
|
+
HyperBench generates realistic low-resolution inputs from
|
|
55
|
+
high-resolution hyperspectral scenes:
|
|
56
|
+
|
|
57
|
+
- Spatial degradation via configurable Point Spread Functions (PSFs)
|
|
58
|
+
- Spectral degradation via configurable Spectral Response Functions
|
|
59
|
+
(SRFs)
|
|
60
|
+
- Controlled noise injection using SNR (dB)
|
|
61
|
+
|
|
62
|
+
------------------------------------------------------------------------
|
|
63
|
+
|
|
64
|
+
### Flexible Experiment Design
|
|
65
|
+
|
|
66
|
+
Users can define experiments using:
|
|
67
|
+
|
|
68
|
+
- Explicit degradation specifications
|
|
69
|
+
- PSF configurations (type, sigma, kernel size)
|
|
70
|
+
- Noise levels (spatial and spectral)
|
|
71
|
+
- MSI band counts
|
|
72
|
+
|
|
73
|
+
------------------------------------------------------------------------
|
|
74
|
+
|
|
75
|
+
### Model-Agnostic Adapter Interface
|
|
76
|
+
|
|
77
|
+
HyperBench works with any model that follows a simple contract:
|
|
78
|
+
|
|
79
|
+
def run_pipeline(HR_MSI, LR_HSI, srf, psf=None, metadata=None): return
|
|
80
|
+
prediction
|
|
81
|
+
|
|
82
|
+
or
|
|
83
|
+
|
|
84
|
+
return prediction, stats
|
|
85
|
+
|
|
86
|
+
Supported formats: - NumPy - TensorFlow - PyTorch
|
|
87
|
+
|
|
88
|
+
------------------------------------------------------------------------
|
|
89
|
+
|
|
90
|
+
### Built-in Metrics
|
|
91
|
+
|
|
92
|
+
- RMSE
|
|
93
|
+
- PSNR
|
|
94
|
+
- SSIM
|
|
95
|
+
- UIQI
|
|
96
|
+
- ERGAS
|
|
97
|
+
- SAM
|
|
98
|
+
|
|
99
|
+
------------------------------------------------------------------------
|
|
100
|
+
|
|
101
|
+
### Output Clipping Policy
|
|
102
|
+
|
|
103
|
+
Optional clipping to \[0,1\] before metric evaluation.
|
|
104
|
+
|
|
105
|
+
------------------------------------------------------------------------
|
|
106
|
+
|
|
107
|
+
### Structured CSV Logging
|
|
108
|
+
|
|
109
|
+
Each experiment produces structured CSV output with: - parameters -
|
|
110
|
+
metrics - optional model stats
|
|
111
|
+
|
|
112
|
+
------------------------------------------------------------------------
|
|
113
|
+
|
|
114
|
+
### Visualization Utilities
|
|
115
|
+
|
|
116
|
+
- RGB visualization
|
|
117
|
+
- band inspection
|
|
118
|
+
- PSF and SRF visualization
|
|
119
|
+
- spectral plots
|
|
120
|
+
|
|
121
|
+
------------------------------------------------------------------------
|
|
122
|
+
|
|
123
|
+
### Framework Support
|
|
124
|
+
|
|
125
|
+
- NumPy
|
|
126
|
+
- TensorFlow
|
|
127
|
+
- PyTorch
|
|
128
|
+
|
|
129
|
+
Automatic device handling included.
|
|
130
|
+
|
|
131
|
+
------------------------------------------------------------------------
|
|
132
|
+
|
|
133
|
+
## Installation
|
|
134
|
+
|
|
135
|
+
pip install hyperbench
|
|
136
|
+
|
|
137
|
+
------------------------------------------------------------------------
|
|
138
|
+
|
|
139
|
+
## Command Line Interface
|
|
140
|
+
|
|
141
|
+
hyperbench run\
|
|
142
|
+
--config config.yaml\
|
|
143
|
+
--pipeline-module path/to/model.py\
|
|
144
|
+
--method-name MyModel\
|
|
145
|
+
--input-backend tensorflow
|
|
146
|
+
|
|
147
|
+
------------------------------------------------------------------------
|
|
148
|
+
|
|
149
|
+
## Configuration
|
|
150
|
+
|
|
151
|
+
Supports JSON and YAML configuration files.
|
|
152
|
+
|
|
153
|
+
------------------------------------------------------------------------
|
|
154
|
+
|
|
155
|
+
## Design Philosophy
|
|
156
|
+
|
|
157
|
+
- Reproducibility
|
|
158
|
+
- Standardization
|
|
159
|
+
- Flexibility
|
|
160
|
+
|
|
161
|
+
------------------------------------------------------------------------
|
|
162
|
+
|
|
163
|
+
## Scope
|
|
164
|
+
|
|
165
|
+
HyperBench is strictly an evaluation framework.
|
|
166
|
+
|
|
167
|
+
------------------------------------------------------------------------
|
|
168
|
+
|
|
169
|
+
## License
|
|
170
|
+
|
|
171
|
+
MIT License
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# HyperBench
|
|
2
|
+
|
|
3
|
+
**HyperBench** is a synthetic benchmarking framework for fusion based hyperspectral
|
|
4
|
+
super-resolution (HSR) methods. It provides a standardized, reproducible
|
|
5
|
+
pipeline for evaluating models using controlled degradations, consistent
|
|
6
|
+
metrics, and structured experiment outputs.
|
|
7
|
+
|
|
8
|
+
HyperBench is designed as an **inference-time evaluation tool**. It does
|
|
9
|
+
not perform model training. Instead, it enables users to test
|
|
10
|
+
already-trained models under a wide range of synthetic scenarios.
|
|
11
|
+
|
|
12
|
+
**Project Home: https://github.com/ritikgshah/HyperBench**. Please visit the github repository for exact implementation details and documentation. This PyPi project is solely meant to serve as the distribution method.
|
|
13
|
+
|
|
14
|
+
------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
## Key Features
|
|
17
|
+
|
|
18
|
+
### Synthetic Degradation Pipeline
|
|
19
|
+
|
|
20
|
+
HyperBench generates realistic low-resolution inputs from
|
|
21
|
+
high-resolution hyperspectral scenes:
|
|
22
|
+
|
|
23
|
+
- Spatial degradation via configurable Point Spread Functions (PSFs)
|
|
24
|
+
- Spectral degradation via configurable Spectral Response Functions
|
|
25
|
+
(SRFs)
|
|
26
|
+
- Controlled noise injection using SNR (dB)
|
|
27
|
+
|
|
28
|
+
------------------------------------------------------------------------
|
|
29
|
+
|
|
30
|
+
### Flexible Experiment Design
|
|
31
|
+
|
|
32
|
+
Users can define experiments using:
|
|
33
|
+
|
|
34
|
+
- Explicit degradation specifications
|
|
35
|
+
- PSF configurations (type, sigma, kernel size)
|
|
36
|
+
- Noise levels (spatial and spectral)
|
|
37
|
+
- MSI band counts
|
|
38
|
+
|
|
39
|
+
------------------------------------------------------------------------
|
|
40
|
+
|
|
41
|
+
### Model-Agnostic Adapter Interface
|
|
42
|
+
|
|
43
|
+
HyperBench works with any model that follows a simple contract:
|
|
44
|
+
|
|
45
|
+
def run_pipeline(HR_MSI, LR_HSI, srf, psf=None, metadata=None): return
|
|
46
|
+
prediction
|
|
47
|
+
|
|
48
|
+
or
|
|
49
|
+
|
|
50
|
+
return prediction, stats
|
|
51
|
+
|
|
52
|
+
Supported formats: - NumPy - TensorFlow - PyTorch
|
|
53
|
+
|
|
54
|
+
------------------------------------------------------------------------
|
|
55
|
+
|
|
56
|
+
### Built-in Metrics
|
|
57
|
+
|
|
58
|
+
- RMSE
|
|
59
|
+
- PSNR
|
|
60
|
+
- SSIM
|
|
61
|
+
- UIQI
|
|
62
|
+
- ERGAS
|
|
63
|
+
- SAM
|
|
64
|
+
|
|
65
|
+
------------------------------------------------------------------------
|
|
66
|
+
|
|
67
|
+
### Output Clipping Policy
|
|
68
|
+
|
|
69
|
+
Optional clipping to \[0,1\] before metric evaluation.
|
|
70
|
+
|
|
71
|
+
------------------------------------------------------------------------
|
|
72
|
+
|
|
73
|
+
### Structured CSV Logging
|
|
74
|
+
|
|
75
|
+
Each experiment produces structured CSV output with: - parameters -
|
|
76
|
+
metrics - optional model stats
|
|
77
|
+
|
|
78
|
+
------------------------------------------------------------------------
|
|
79
|
+
|
|
80
|
+
### Visualization Utilities
|
|
81
|
+
|
|
82
|
+
- RGB visualization
|
|
83
|
+
- band inspection
|
|
84
|
+
- PSF and SRF visualization
|
|
85
|
+
- spectral plots
|
|
86
|
+
|
|
87
|
+
------------------------------------------------------------------------
|
|
88
|
+
|
|
89
|
+
### Framework Support
|
|
90
|
+
|
|
91
|
+
- NumPy
|
|
92
|
+
- TensorFlow
|
|
93
|
+
- PyTorch
|
|
94
|
+
|
|
95
|
+
Automatic device handling included.
|
|
96
|
+
|
|
97
|
+
------------------------------------------------------------------------
|
|
98
|
+
|
|
99
|
+
## Installation
|
|
100
|
+
|
|
101
|
+
pip install hyperbench
|
|
102
|
+
|
|
103
|
+
------------------------------------------------------------------------
|
|
104
|
+
|
|
105
|
+
## Command Line Interface
|
|
106
|
+
|
|
107
|
+
hyperbench run\
|
|
108
|
+
--config config.yaml\
|
|
109
|
+
--pipeline-module path/to/model.py\
|
|
110
|
+
--method-name MyModel\
|
|
111
|
+
--input-backend tensorflow
|
|
112
|
+
|
|
113
|
+
------------------------------------------------------------------------
|
|
114
|
+
|
|
115
|
+
## Configuration
|
|
116
|
+
|
|
117
|
+
Supports JSON and YAML configuration files.
|
|
118
|
+
|
|
119
|
+
------------------------------------------------------------------------
|
|
120
|
+
|
|
121
|
+
## Design Philosophy
|
|
122
|
+
|
|
123
|
+
- Reproducibility
|
|
124
|
+
- Standardization
|
|
125
|
+
- Flexibility
|
|
126
|
+
|
|
127
|
+
------------------------------------------------------------------------
|
|
128
|
+
|
|
129
|
+
## Scope
|
|
130
|
+
|
|
131
|
+
HyperBench is strictly an evaluation framework.
|
|
132
|
+
|
|
133
|
+
------------------------------------------------------------------------
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
MIT License
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Author: Ritik Shah
|
|
2
|
+
|
|
3
|
+
[build-system]
|
|
4
|
+
requires = ["setuptools>=68", "wheel"]
|
|
5
|
+
build-backend = "setuptools.build_meta"
|
|
6
|
+
|
|
7
|
+
[project]
|
|
8
|
+
name = "hyperbench"
|
|
9
|
+
version = "0.1.0"
|
|
10
|
+
description = "Synthetic benchmarking for hyperspectral super-resolution methods"
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
requires-python = ">=3.9"
|
|
13
|
+
license = { text = "MIT" }
|
|
14
|
+
authors = [
|
|
15
|
+
{ name = "HyperBench Authors" }
|
|
16
|
+
]
|
|
17
|
+
keywords = [
|
|
18
|
+
"hyperspectral imaging",
|
|
19
|
+
"super-resolution",
|
|
20
|
+
"remote sensing",
|
|
21
|
+
"benchmarking",
|
|
22
|
+
"image fusion",
|
|
23
|
+
]
|
|
24
|
+
classifiers = [
|
|
25
|
+
"Development Status :: 3 - Alpha",
|
|
26
|
+
"Intended Audience :: Science/Research",
|
|
27
|
+
"License :: OSI Approved :: MIT License",
|
|
28
|
+
"Programming Language :: Python :: 3",
|
|
29
|
+
"Programming Language :: Python :: 3.9",
|
|
30
|
+
"Topic :: Scientific/Engineering :: Image Processing",
|
|
31
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
dependencies = [
|
|
35
|
+
"numpy==1.26.4",
|
|
36
|
+
"scipy>=1.10",
|
|
37
|
+
"opencv-python==4.9.0.80",
|
|
38
|
+
"matplotlib>=3.7",
|
|
39
|
+
"sewar>=0.4.6",
|
|
40
|
+
"spectral>=0.23",
|
|
41
|
+
"ipykernel>=6.29",
|
|
42
|
+
"jupyterlab>=4.0",
|
|
43
|
+
"pyyaml>=6.0"
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[project.optional-dependencies]
|
|
47
|
+
dev = [
|
|
48
|
+
"pytest>=8.0",
|
|
49
|
+
"pytest-cov>=4.1",
|
|
50
|
+
"build>=1.2",
|
|
51
|
+
"twine>=5.0",
|
|
52
|
+
"ruff>=0.6",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[project.scripts]
|
|
56
|
+
hyperbench = "hyperbench.cli:main"
|
|
57
|
+
|
|
58
|
+
[tool.setuptools]
|
|
59
|
+
package-dir = {"" = "src"}
|
|
60
|
+
|
|
61
|
+
[tool.setuptools.packages.find]
|
|
62
|
+
where = ["src"]
|
|
63
|
+
|
|
64
|
+
[tool.pytest.ini_options]
|
|
65
|
+
testpaths = ["tests"]
|
|
66
|
+
pythonpath = ["src"]
|
|
67
|
+
addopts = "-ra"
|
|
68
|
+
|
|
69
|
+
[tool.ruff]
|
|
70
|
+
line-length = 100
|
|
71
|
+
target-version = "py39"
|
|
72
|
+
|
|
73
|
+
[tool.ruff.lint]
|
|
74
|
+
select = ["E", "F", "I", "B"]
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Author: Ritik Shah
|
|
2
|
+
|
|
3
|
+
"""HyperBench: synthetic benchmarking for hyperspectral super-resolution."""
|
|
4
|
+
|
|
5
|
+
from .__about__ import __version__
|
|
6
|
+
|
|
7
|
+
from .adapters import (
|
|
8
|
+
BaseAdapter,
|
|
9
|
+
CallableAdapter,
|
|
10
|
+
PipelineAdapter,
|
|
11
|
+
ReconstructionInputs,
|
|
12
|
+
TensorFlowModelAdapter,
|
|
13
|
+
TorchModelAdapter,
|
|
14
|
+
)
|
|
15
|
+
from .benchmark import (
|
|
16
|
+
BenchmarkCase,
|
|
17
|
+
BenchmarkConfig,
|
|
18
|
+
BenchmarkResults,
|
|
19
|
+
DegradationSpec,
|
|
20
|
+
SyntheticCase,
|
|
21
|
+
generate_cases,
|
|
22
|
+
run_benchmark,
|
|
23
|
+
)
|
|
24
|
+
from .config import benchmark_config_from_dict, load_benchmark_config
|
|
25
|
+
from .degradations import (
|
|
26
|
+
AVAILABLE_PSFS,
|
|
27
|
+
SUPPORTED_SRF_BAND_COUNTS,
|
|
28
|
+
make_psf,
|
|
29
|
+
normalize_image,
|
|
30
|
+
spatial_degradation,
|
|
31
|
+
spectral_degradation,
|
|
32
|
+
)
|
|
33
|
+
from .exceptions import (
|
|
34
|
+
AdapterError,
|
|
35
|
+
AdapterOutputError,
|
|
36
|
+
ConfigurationError,
|
|
37
|
+
FrameworkAvailabilityError,
|
|
38
|
+
HyperBenchError,
|
|
39
|
+
IOValidationError,
|
|
40
|
+
MetricsError,
|
|
41
|
+
PipelineError,
|
|
42
|
+
SceneKeyError,
|
|
43
|
+
ShapeMismatchError,
|
|
44
|
+
UnsupportedPSFError,
|
|
45
|
+
UnsupportedSRFError,
|
|
46
|
+
)
|
|
47
|
+
from .io import load_hsi
|
|
48
|
+
from .metrics import (
|
|
49
|
+
AVAILABLE_METRICS,
|
|
50
|
+
DEFAULT_METRICS,
|
|
51
|
+
compute_ergas,
|
|
52
|
+
compute_psnr,
|
|
53
|
+
compute_rmse,
|
|
54
|
+
compute_sam,
|
|
55
|
+
compute_ssim,
|
|
56
|
+
compute_uiqi,
|
|
57
|
+
evaluate_metrics,
|
|
58
|
+
)
|
|
59
|
+
from .types import Array, Metadata, PathLike
|
|
60
|
+
from .utils import (
|
|
61
|
+
convert_prediction_to_numpy_hwc,
|
|
62
|
+
get_preferred_tensorflow_device,
|
|
63
|
+
get_preferred_torch_device,
|
|
64
|
+
get_tensorflow_device_info,
|
|
65
|
+
get_torch_device_info,
|
|
66
|
+
is_tensorflow_available,
|
|
67
|
+
is_torch_available,
|
|
68
|
+
numpy_hwc_to_tf_image,
|
|
69
|
+
numpy_hwc_to_torch_image,
|
|
70
|
+
numpy_prediction_to_hwc,
|
|
71
|
+
numpy_to_tf_matrix,
|
|
72
|
+
numpy_to_torch_matrix,
|
|
73
|
+
plot_spectra,
|
|
74
|
+
print_data_stats,
|
|
75
|
+
print_framework_device_summary,
|
|
76
|
+
tf_image_to_numpy_hwc,
|
|
77
|
+
tf_matrix_to_numpy,
|
|
78
|
+
torch_image_to_numpy_hwc,
|
|
79
|
+
torch_matrix_to_numpy,
|
|
80
|
+
visualize_band,
|
|
81
|
+
visualize_hsi,
|
|
82
|
+
visualize_multispectral_with_srf,
|
|
83
|
+
visualize_psfs,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
__all__ = [
|
|
87
|
+
"__version__",
|
|
88
|
+
"Array",
|
|
89
|
+
"PathLike",
|
|
90
|
+
"Metadata",
|
|
91
|
+
"HyperBenchError",
|
|
92
|
+
"ConfigurationError",
|
|
93
|
+
"IOValidationError",
|
|
94
|
+
"SceneKeyError",
|
|
95
|
+
"ShapeMismatchError",
|
|
96
|
+
"UnsupportedPSFError",
|
|
97
|
+
"UnsupportedSRFError",
|
|
98
|
+
"AdapterError",
|
|
99
|
+
"AdapterOutputError",
|
|
100
|
+
"PipelineError",
|
|
101
|
+
"MetricsError",
|
|
102
|
+
"FrameworkAvailabilityError",
|
|
103
|
+
"BaseAdapter",
|
|
104
|
+
"CallableAdapter",
|
|
105
|
+
"PipelineAdapter",
|
|
106
|
+
"TorchModelAdapter",
|
|
107
|
+
"TensorFlowModelAdapter",
|
|
108
|
+
"ReconstructionInputs",
|
|
109
|
+
"DegradationSpec",
|
|
110
|
+
"BenchmarkConfig",
|
|
111
|
+
"BenchmarkCase",
|
|
112
|
+
"SyntheticCase",
|
|
113
|
+
"BenchmarkResults",
|
|
114
|
+
"generate_cases",
|
|
115
|
+
"run_benchmark",
|
|
116
|
+
"benchmark_config_from_dict",
|
|
117
|
+
"load_benchmark_config",
|
|
118
|
+
"load_hsi",
|
|
119
|
+
"AVAILABLE_PSFS",
|
|
120
|
+
"SUPPORTED_SRF_BAND_COUNTS",
|
|
121
|
+
"make_psf",
|
|
122
|
+
"normalize_image",
|
|
123
|
+
"spatial_degradation",
|
|
124
|
+
"spectral_degradation",
|
|
125
|
+
"AVAILABLE_METRICS",
|
|
126
|
+
"DEFAULT_METRICS",
|
|
127
|
+
"compute_rmse",
|
|
128
|
+
"compute_psnr",
|
|
129
|
+
"compute_ssim",
|
|
130
|
+
"compute_uiqi",
|
|
131
|
+
"compute_ergas",
|
|
132
|
+
"compute_sam",
|
|
133
|
+
"evaluate_metrics",
|
|
134
|
+
"print_data_stats",
|
|
135
|
+
"visualize_hsi",
|
|
136
|
+
"visualize_band",
|
|
137
|
+
"visualize_multispectral_with_srf",
|
|
138
|
+
"plot_spectra",
|
|
139
|
+
"visualize_psfs",
|
|
140
|
+
"is_torch_available",
|
|
141
|
+
"is_tensorflow_available",
|
|
142
|
+
"get_torch_device_info",
|
|
143
|
+
"get_tensorflow_device_info",
|
|
144
|
+
"get_preferred_torch_device",
|
|
145
|
+
"get_preferred_tensorflow_device",
|
|
146
|
+
"print_framework_device_summary",
|
|
147
|
+
"numpy_hwc_to_tf_image",
|
|
148
|
+
"tf_image_to_numpy_hwc",
|
|
149
|
+
"numpy_to_tf_matrix",
|
|
150
|
+
"tf_matrix_to_numpy",
|
|
151
|
+
"numpy_hwc_to_torch_image",
|
|
152
|
+
"torch_image_to_numpy_hwc",
|
|
153
|
+
"numpy_to_torch_matrix",
|
|
154
|
+
"torch_matrix_to_numpy",
|
|
155
|
+
"numpy_prediction_to_hwc",
|
|
156
|
+
"convert_prediction_to_numpy_hwc",
|
|
157
|
+
]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Author: Ritik Shah
|
|
2
|
+
|
|
3
|
+
"""Model adapter layer for HyperBench."""
|
|
4
|
+
|
|
5
|
+
from .base import BaseAdapter, ReconstructionInputs, ShapePolicy
|
|
6
|
+
from .callable import CallableAdapter
|
|
7
|
+
from .pipeline import PipelineAdapter
|
|
8
|
+
from .tensorflow import TensorFlowModelAdapter
|
|
9
|
+
from .torch import TorchModelAdapter
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"ShapePolicy",
|
|
13
|
+
"ReconstructionInputs",
|
|
14
|
+
"BaseAdapter",
|
|
15
|
+
"CallableAdapter",
|
|
16
|
+
"PipelineAdapter",
|
|
17
|
+
"TorchModelAdapter",
|
|
18
|
+
"TensorFlowModelAdapter",
|
|
19
|
+
]
|