graxpert 3.2.0a0.dev6__tar.gz → 3.2.0a0.dev8__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.
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/PKG-INFO +23 -10
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/README.md +17 -5
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/ai_model_handling.py +76 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/background_extraction.py +4 -9
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/deconvolution.py +6 -10
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/denoising.py +4 -9
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/main.py +2 -1
- graxpert-3.2.0a0.dev8/graxpert/version.py +2 -0
- graxpert-3.2.0a0.dev8/graxpert/version.py.bak +2 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert.egg-info/PKG-INFO +23 -10
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert.egg-info/requires.txt +4 -4
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert.egg-info/top_level.txt +1 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/pyproject.toml +2 -2
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/requirements.txt +4 -4
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/setup.py +9 -4
- graxpert-3.2.0a0.dev6/graxpert/version.py +0 -2
- graxpert-3.2.0a0.dev6/graxpert/version.py.bak +0 -2
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/MANIFEST.in +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/AstroImageRepository.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/__init__.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/app_state.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/application/__init__.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/application/app.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/application/app_events.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/application/eventbus.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/astroimage.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/background_flood_selection.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/background_grid_selection.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/cmdline_tools.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/commands.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/grid_utils.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/img/GraXpert_LOGO_Hauptvariante.png +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/img/Icon.png +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/img/LDN1235_original.jpg +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/img/LDN1235_processed.jpg +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/img/__init__.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/img/gfx_numbers.png +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/img/gfx_numbers.svg +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/img/graXpert_Startbadge_Umbriel.png +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/img/hourglass.png +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/locales/__init__.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/locales/base.pot +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/locales/de_DE/LC_MESSAGES/base.mo +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/locales/de_DE/LC_MESSAGES/base.po +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/localization.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/mp_logging.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/parallel_processing.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/preferences.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/radialbasisinterpolation.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/resource_utils.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/s3_secrets.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/skyall.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/stretch.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/theme/__init__.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/theme/graxpert-dark-blue.json +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/ui/__init__.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/ui/application_frame.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/ui/canvas.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/ui/left_menu.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/ui/loadingframe.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/ui/right_menu.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/ui/statusbar.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/ui/styling.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/ui/tooltip.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/ui/ui_events.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/ui/widgets.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/ui_scaling.py +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert.egg-info/SOURCES.txt +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert.egg-info/dependency_links.txt +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert.egg-info/entry_points.txt +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/img/Icon.icns +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/img/Icon.ico +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/img/Icon.png +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/img/NGC7000_original.jpg +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/img/NGC7000_processed.jpg +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/img/graXpert_Startbadge_Ariel.png +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/img/graXpert_Startbadge_Ariel.svg +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/img/graXpert_Startbadge_Dione.png +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/img/graXpert_Startbadge_Dione.svg +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/img/graXpert_Startbadge_Tethys.png +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/img/graXpert_Startbadge_Tethys.svg +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/img/graXpert_Startbadge_Umbriel.png +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/img/graXpert_Startbadge_Umbriel.svg +0 -0
- {graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: graxpert
|
|
3
|
-
Version: 3.2.0a0.
|
|
3
|
+
Version: 3.2.0a0.dev8
|
|
4
4
|
Summary: GraXpert is an astronomical image processing program for extracting and removing gradients in the background of your astrophotos
|
|
5
5
|
Home-page: https://graxpert.com
|
|
6
6
|
Author: GraXpert Development Team
|
|
@@ -15,6 +15,7 @@ Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
|
15
15
|
Classifier: Topic :: Multimedia :: Graphics :: Editors
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
19
|
Classifier: Operating System :: Microsoft :: Windows
|
|
19
20
|
Classifier: Operating System :: MacOS
|
|
20
21
|
Classifier: Operating System :: POSIX :: Linux
|
|
@@ -28,17 +29,17 @@ Description-Content-Type: text/markdown
|
|
|
28
29
|
Requires-Dist: ml-dtypes>=0.5.3
|
|
29
30
|
Requires-Dist: pillow>=11.3.0
|
|
30
31
|
Requires-Dist: appdirs
|
|
31
|
-
Requires-Dist: astropy>=6.1
|
|
32
|
+
Requires-Dist: astropy>=6.0.1
|
|
32
33
|
Requires-Dist: astropy-iers-data>=0.2025.9.1.0.42.11
|
|
33
34
|
Requires-Dist: customtkinter>=5.2.2
|
|
34
35
|
Requires-Dist: imageio>=2.37.0
|
|
35
36
|
Requires-Dist: minio>=7.2.16
|
|
36
|
-
Requires-Dist: numpy
|
|
37
|
+
Requires-Dist: numpy<=2.2.6,>=2.0.2
|
|
37
38
|
Requires-Dist: opencv-python-headless==4.11.0.86
|
|
38
39
|
Requires-Dist: PyKrige>=1.7.2
|
|
39
40
|
Requires-Dist: requests>=2.32.5
|
|
40
|
-
Requires-Dist: scikit-image>=0.
|
|
41
|
-
Requires-Dist: scipy>=1.
|
|
41
|
+
Requires-Dist: scikit-image>=0.24.0
|
|
42
|
+
Requires-Dist: scipy>=1.13.1
|
|
42
43
|
Requires-Dist: xisf>=0.9.5
|
|
43
44
|
Provides-Extra: cuda
|
|
44
45
|
Requires-Dist: onnxruntime-gpu[cuda,cudnn]==1.22.0; extra == "cuda"
|
|
@@ -95,17 +96,29 @@ We do this via the the python [pypi.org](https://pypi.org/project/graxpert/) rep
|
|
|
95
96
|
1. Install [python](https://www.python.org/downloads/) runtime for your OS. The default install should automatically include the python package manager 'pip'.
|
|
96
97
|
2. At a shell prompt type the correct flavor of graxpert to install for your needs.
|
|
97
98
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
* **pip install graxpert\[cpuonly\]** - Use this if you are on OS-X - it is poorly named, but it will still use the CoreML Apple GPU support
|
|
99
|
+
* **brew install pipx python-tk@3.13; pipx install --python python3.13 graxpert\\\[cpuonly\\\]** - Use this if you are on OS-X - it is poorly named, but it will still use the CoreML Apple GPU support
|
|
101
100
|
* **pip install graxpert\[cuda\]** - Use this if you have an Nvidia GPU
|
|
102
|
-
* **pip install graxpert\[rocm\]** - Use this if you have an AMD GPU
|
|
101
|
+
* **pip install graxpert\[rocm\]** --pip-args="-f https://repo.radeon.com/rocm/manylinux/rocm-rel-7.0/" - Use this if you have an AMD GPU
|
|
103
102
|
* **pip install graxpert\[openvino\]** - Use this if you don't have an advanced GPU or don't know what you have (provides sizable acceleration on most modern Intel CPUs)
|
|
104
103
|
* **pip install graxpert\[directml\]** - Use this if you want the Windows DirectML acceleration (not as fast as the options above but widely supported and easy to install)
|
|
105
104
|
* **pip install graxpert\[cpuonly\]** - If you encounter bugs with any of our GPU versions, please file a bug and temporarily use this version (which excludes all GPU code)
|
|
106
105
|
|
|
107
106
|
If you are an advanced python user and know about the 'pipx' tool, we recommend that you use that tool instead of pip for installs.
|
|
108
107
|
|
|
108
|
+
## AMD GPU library installation
|
|
109
|
+
|
|
110
|
+
If you are using an AMD GPU and the python packages above, you'll probably need to install the latest AMD GPU software.
|
|
111
|
+
|
|
112
|
+
For Ubuntu linux the instructions run:
|
|
113
|
+
```
|
|
114
|
+
wget https://repo.radeon.com/amdgpu-install/7.0.1/ubuntu/noble/amdgpu-install_7.0.1.70001-1_all.deb
|
|
115
|
+
sudo apt install ./amdgpu-install_7.0.1.70001-1_all.deb
|
|
116
|
+
sudo apt update
|
|
117
|
+
sudo apt install rocm python3-tk
|
|
118
|
+
sudo usermod -a -G render,video $LOGNAME # Add the current user to the render and video groups
|
|
119
|
+
```
|
|
120
|
+
For other OSes see the instructions [here](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html).
|
|
121
|
+
|
|
109
122
|
# Legacy Installation
|
|
110
123
|
You can download the latest official release of GraXpert [here](https://github.com/Steffenhir/GraXpert/releases/latest). Select the correct version for your operating system. For macOS, we provide different versions
|
|
111
124
|
for Intel processors (x86_64) and for apple silicon (arm64).
|
|
@@ -200,7 +213,7 @@ For macOS, we have to install tkinter separately.
|
|
|
200
213
|
We use the version provided by brew because it is newer
|
|
201
214
|
and solves issues with macOS Sonoma. Please use the version matching with your Python version.
|
|
202
215
|
"""
|
|
203
|
-
brew install python-tk
|
|
216
|
+
brew install python-tk
|
|
204
217
|
```
|
|
205
218
|
|
|
206
219
|
## Option 2: Automatic setup with devcontainers
|
|
@@ -29,17 +29,29 @@ We do this via the the python [pypi.org](https://pypi.org/project/graxpert/) rep
|
|
|
29
29
|
1. Install [python](https://www.python.org/downloads/) runtime for your OS. The default install should automatically include the python package manager 'pip'.
|
|
30
30
|
2. At a shell prompt type the correct flavor of graxpert to install for your needs.
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* **pip install graxpert\[cpuonly\]** - Use this if you are on OS-X - it is poorly named, but it will still use the CoreML Apple GPU support
|
|
32
|
+
* **brew install pipx python-tk@3.13; pipx install --python python3.13 graxpert\\\[cpuonly\\\]** - Use this if you are on OS-X - it is poorly named, but it will still use the CoreML Apple GPU support
|
|
35
33
|
* **pip install graxpert\[cuda\]** - Use this if you have an Nvidia GPU
|
|
36
|
-
* **pip install graxpert\[rocm\]** - Use this if you have an AMD GPU
|
|
34
|
+
* **pip install graxpert\[rocm\]** --pip-args="-f https://repo.radeon.com/rocm/manylinux/rocm-rel-7.0/" - Use this if you have an AMD GPU
|
|
37
35
|
* **pip install graxpert\[openvino\]** - Use this if you don't have an advanced GPU or don't know what you have (provides sizable acceleration on most modern Intel CPUs)
|
|
38
36
|
* **pip install graxpert\[directml\]** - Use this if you want the Windows DirectML acceleration (not as fast as the options above but widely supported and easy to install)
|
|
39
37
|
* **pip install graxpert\[cpuonly\]** - If you encounter bugs with any of our GPU versions, please file a bug and temporarily use this version (which excludes all GPU code)
|
|
40
38
|
|
|
41
39
|
If you are an advanced python user and know about the 'pipx' tool, we recommend that you use that tool instead of pip for installs.
|
|
42
40
|
|
|
41
|
+
## AMD GPU library installation
|
|
42
|
+
|
|
43
|
+
If you are using an AMD GPU and the python packages above, you'll probably need to install the latest AMD GPU software.
|
|
44
|
+
|
|
45
|
+
For Ubuntu linux the instructions run:
|
|
46
|
+
```
|
|
47
|
+
wget https://repo.radeon.com/amdgpu-install/7.0.1/ubuntu/noble/amdgpu-install_7.0.1.70001-1_all.deb
|
|
48
|
+
sudo apt install ./amdgpu-install_7.0.1.70001-1_all.deb
|
|
49
|
+
sudo apt update
|
|
50
|
+
sudo apt install rocm python3-tk
|
|
51
|
+
sudo usermod -a -G render,video $LOGNAME # Add the current user to the render and video groups
|
|
52
|
+
```
|
|
53
|
+
For other OSes see the instructions [here](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html).
|
|
54
|
+
|
|
43
55
|
# Legacy Installation
|
|
44
56
|
You can download the latest official release of GraXpert [here](https://github.com/Steffenhir/GraXpert/releases/latest). Select the correct version for your operating system. For macOS, we provide different versions
|
|
45
57
|
for Intel processors (x86_64) and for apple silicon (arm64).
|
|
@@ -134,7 +146,7 @@ For macOS, we have to install tkinter separately.
|
|
|
134
146
|
We use the version provided by brew because it is newer
|
|
135
147
|
and solves issues with macOS Sonoma. Please use the version matching with your Python version.
|
|
136
148
|
"""
|
|
137
|
-
brew install python-tk
|
|
149
|
+
brew install python-tk
|
|
138
150
|
```
|
|
139
151
|
|
|
140
152
|
## Option 2: Automatic setup with devcontainers
|
|
@@ -4,6 +4,7 @@ import sys
|
|
|
4
4
|
import re
|
|
5
5
|
import shutil
|
|
6
6
|
import zipfile
|
|
7
|
+
from multiprocessing import Process, Queue
|
|
7
8
|
|
|
8
9
|
from appdirs import user_data_dir
|
|
9
10
|
from minio import Minio
|
|
@@ -213,3 +214,78 @@ def get_execution_providers_ordered(gpu_acceleration=True):
|
|
|
213
214
|
"If you are using one of our prebuilt executables, please file a bug with the following information:\n"
|
|
214
215
|
"{}".format(e))
|
|
215
216
|
sys.exit(1)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def run_in_process(fn: callable):
|
|
220
|
+
"""Run a function in a separate process and return the result or raise an exception."""
|
|
221
|
+
|
|
222
|
+
q = Queue()
|
|
223
|
+
|
|
224
|
+
# Create a closure to call fn and put the result in the queue
|
|
225
|
+
def wrapped():
|
|
226
|
+
try:
|
|
227
|
+
r = fn()
|
|
228
|
+
except Exception as e:
|
|
229
|
+
r = e # return the exception to the main process
|
|
230
|
+
q.put(r)
|
|
231
|
+
|
|
232
|
+
p = Process(target=wrapped, name="ai-worker")
|
|
233
|
+
p.start()
|
|
234
|
+
p.join()
|
|
235
|
+
|
|
236
|
+
if p.exitcode != 0:
|
|
237
|
+
raise RuntimeError(f"worker process crashed with exit code {p.exitcode}.")
|
|
238
|
+
|
|
239
|
+
result = q.get()
|
|
240
|
+
if isinstance(result, Exception):
|
|
241
|
+
raise result
|
|
242
|
+
return result
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
# Provides a mutable session context that can swap out different sessions if needed
|
|
246
|
+
class SessionContext:
|
|
247
|
+
model_name: str
|
|
248
|
+
session: any # onnxruntime.InferenceSession
|
|
249
|
+
|
|
250
|
+
def __init__(self, model_name: str, gpu_acceleration: bool = True):
|
|
251
|
+
"""Initialize the ONNX model session with the specified execution provider."""
|
|
252
|
+
|
|
253
|
+
providers = get_execution_providers_ordered(gpu_acceleration)
|
|
254
|
+
logging.info(f"Available inference providers : {providers}")
|
|
255
|
+
|
|
256
|
+
import onnxruntime as ort # Must be after get_execution_providers_ordered (so it can check for missing libs)
|
|
257
|
+
self.session = ort.InferenceSession(model_name, providers=providers)
|
|
258
|
+
self.model_name = model_name
|
|
259
|
+
|
|
260
|
+
logging.info(f"Used inference providers for {model_name}: {self.session.get_providers()}")
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
def __run_low(self, model_args: dict, gpu_acceleration: bool = True) -> any:
|
|
264
|
+
"""Run the ONNX model using the specified execution provider."""
|
|
265
|
+
|
|
266
|
+
# if we are using a GPU the ONNX runtimes might crash due to native bugs (ROCm)
|
|
267
|
+
# so run in a separate process just in case
|
|
268
|
+
fn = lambda: self.session.run(None, model_args)
|
|
269
|
+
if gpu_acceleration:
|
|
270
|
+
return run_in_process(fn)
|
|
271
|
+
else:
|
|
272
|
+
return fn()
|
|
273
|
+
|
|
274
|
+
def run(self, model_args: dict) -> any:
|
|
275
|
+
"""Run the ONNX model using the specified execution provider."""
|
|
276
|
+
|
|
277
|
+
providers = self.session.get_providers()
|
|
278
|
+
gpu_acceleration = len(providers) > 1 or providers[0] != "CPUExecutionProvider"
|
|
279
|
+
try:
|
|
280
|
+
result = self.__run_low(model_args, gpu_acceleration)
|
|
281
|
+
except Exception as e:
|
|
282
|
+
if not gpu_acceleration:
|
|
283
|
+
raise # Rethrow, the failure occurred with the regular CPU model also - show error dialog
|
|
284
|
+
|
|
285
|
+
logging.warning(f"Error running model, falling back to CPU only: {e}")
|
|
286
|
+
import onnxruntime as ort
|
|
287
|
+
self.session = ort.InferenceSession(self.model_name, providers=get_execution_providers_ordered(False))
|
|
288
|
+
result = self.__run_low(model_args, False)
|
|
289
|
+
|
|
290
|
+
# all graxpert results are in the first array index
|
|
291
|
+
return result[0]
|
|
@@ -12,7 +12,7 @@ from astropy.stats import sigma_clipped_stats
|
|
|
12
12
|
from pykrige.ok import OrdinaryKriging
|
|
13
13
|
from scipy import interpolate, linalg
|
|
14
14
|
|
|
15
|
-
from graxpert.ai_model_handling import
|
|
15
|
+
from graxpert.ai_model_handling import SessionContext
|
|
16
16
|
from graxpert.mp_logging import get_logging_queue, worker_configurer
|
|
17
17
|
from graxpert.parallel_processing import executor
|
|
18
18
|
from graxpert.radialbasisinterpolation import RadialBasisInterpolation
|
|
@@ -69,14 +69,9 @@ def extract_background(in_imarray, background_points, interpolation_type, smooth
|
|
|
69
69
|
if progress is not None:
|
|
70
70
|
progress.update(8)
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
logging.info(f"Providers : {providers}")
|
|
77
|
-
logging.info(f"Used providers : {session.get_providers()}")
|
|
78
|
-
|
|
79
|
-
background = session.run(None, {"gen_input_image": np.expand_dims(imarray_shrink, axis=0)})[0][0]
|
|
72
|
+
# allow persistent changes to gpu_accel in case of failure
|
|
73
|
+
context = SessionContext(ai_path, gpu_acceleration=ai_gpu_acceleration)
|
|
74
|
+
background = context.run({"gen_input_image": np.expand_dims(imarray_shrink, axis=0)})[0]
|
|
80
75
|
|
|
81
76
|
background = background / 0.04 * mad + median
|
|
82
77
|
|
|
@@ -3,7 +3,7 @@ import logging
|
|
|
3
3
|
|
|
4
4
|
import numpy as np
|
|
5
5
|
|
|
6
|
-
from graxpert.ai_model_handling import
|
|
6
|
+
from graxpert.ai_model_handling import SessionContext
|
|
7
7
|
from graxpert.application.app_events import AppEvents
|
|
8
8
|
from graxpert.application.eventbus import eventbus
|
|
9
9
|
|
|
@@ -63,13 +63,6 @@ def deconvolve(image, ai_path, strength, psfsize, batch_size=4, window_size=512,
|
|
|
63
63
|
|
|
64
64
|
output = copy.deepcopy(image)
|
|
65
65
|
|
|
66
|
-
providers = get_execution_providers_ordered(ai_gpu_acceleration)
|
|
67
|
-
import onnxruntime as ort # Must be after get_execution_providers_ordered
|
|
68
|
-
session = ort.InferenceSession(ai_path, providers=providers)
|
|
69
|
-
|
|
70
|
-
logging.info(f"Available inference providers : {providers}")
|
|
71
|
-
logging.info(f"Used inference providers : {session.get_providers()}")
|
|
72
|
-
|
|
73
66
|
cancel_flag = False
|
|
74
67
|
|
|
75
68
|
def cancel_listener(event):
|
|
@@ -78,6 +71,8 @@ def deconvolve(image, ai_path, strength, psfsize, batch_size=4, window_size=512,
|
|
|
78
71
|
|
|
79
72
|
eventbus.add_listener(AppEvents.CANCEL_PROCESSING, cancel_listener)
|
|
80
73
|
|
|
74
|
+
# allow persistent changes to gpu_accel in case of failure
|
|
75
|
+
context = SessionContext(ai_path, gpu_acceleration=ai_gpu_acceleration)
|
|
81
76
|
last_progress = 0
|
|
82
77
|
for b in range(0, ith * itw + batch_size, batch_size):
|
|
83
78
|
|
|
@@ -129,9 +124,10 @@ def deconvolve(image, ai_path, strength, psfsize, batch_size=4, window_size=512,
|
|
|
129
124
|
strenght_p = np.full(shape=(input_tiles.shape[0], 1), fill_value=strength, dtype=np.float32)
|
|
130
125
|
conds = np.concatenate([sigma, strenght_p], axis=-1)
|
|
131
126
|
if type == "Obj" and "1.0.0" in ai_path:
|
|
132
|
-
|
|
127
|
+
model_args = {"gen_input_image": input_tiles, "sigma": sigma, "strenght": strenght_p}
|
|
133
128
|
else:
|
|
134
|
-
|
|
129
|
+
model_args = {"gen_input_image": input_tiles, "params": conds}
|
|
130
|
+
session_result = context.run(model_args)
|
|
135
131
|
for e in session_result:
|
|
136
132
|
output_tiles.append(e)
|
|
137
133
|
|
|
@@ -4,7 +4,7 @@ import time
|
|
|
4
4
|
|
|
5
5
|
import numpy as np
|
|
6
6
|
|
|
7
|
-
from graxpert.ai_model_handling import
|
|
7
|
+
from graxpert.ai_model_handling import SessionContext
|
|
8
8
|
from graxpert.application.app_events import AppEvents
|
|
9
9
|
from graxpert.application.eventbus import eventbus
|
|
10
10
|
from graxpert.ui.ui_events import UiEvents
|
|
@@ -64,13 +64,6 @@ def denoise(image, ai_path, strength, batch_size=4, window_size=256, stride=128,
|
|
|
64
64
|
|
|
65
65
|
output = copy.deepcopy(image)
|
|
66
66
|
|
|
67
|
-
providers = get_execution_providers_ordered(ai_gpu_acceleration)
|
|
68
|
-
import onnxruntime as ort # Must be after get_execution_providers_ordered
|
|
69
|
-
session = ort.InferenceSession(ai_path, providers=providers)
|
|
70
|
-
|
|
71
|
-
logging.info(f"Available inference providers : {providers}")
|
|
72
|
-
logging.info(f"Used inference providers : {session.get_providers()}")
|
|
73
|
-
|
|
74
67
|
cancel_flag = False
|
|
75
68
|
|
|
76
69
|
def cancel_listener(event):
|
|
@@ -79,6 +72,8 @@ def denoise(image, ai_path, strength, batch_size=4, window_size=256, stride=128,
|
|
|
79
72
|
|
|
80
73
|
eventbus.add_listener(AppEvents.CANCEL_PROCESSING, cancel_listener)
|
|
81
74
|
|
|
75
|
+
# allow persistent changes to gpu_accel in case of failure
|
|
76
|
+
context = SessionContext(ai_path, gpu_acceleration=ai_gpu_acceleration)
|
|
82
77
|
last_progress = 0
|
|
83
78
|
for b in range(0, ith * itw + batch_size, batch_size):
|
|
84
79
|
|
|
@@ -114,7 +109,7 @@ def denoise(image, ai_path, strength, batch_size=4, window_size=256, stride=128,
|
|
|
114
109
|
input_tiles = np.array(input_tiles)
|
|
115
110
|
|
|
116
111
|
output_tiles = []
|
|
117
|
-
session_result =
|
|
112
|
+
session_result = context.run({ "gen_input_image": input_tiles})
|
|
118
113
|
for e in session_result:
|
|
119
114
|
output_tiles.append(e)
|
|
120
115
|
|
|
@@ -28,7 +28,8 @@ except ImportError:
|
|
|
28
28
|
print(" For Debian/Ubuntu: sudo apt-get install python3-tk", file=sys.stderr)
|
|
29
29
|
print(" For Fedora: sudo dnf install python3-tkinter", file=sys.stderr)
|
|
30
30
|
print(" For Arch Linux: sudo pacman -S tk", file=sys.stderr)
|
|
31
|
-
print(" For
|
|
31
|
+
print(" For OS-X: brew install python-tk", file=sys.stderr)
|
|
32
|
+
print(" For Windows: It should be included with your Python installation by default.", file=sys.stderr)
|
|
32
33
|
sys.exit(1) # Exit with error
|
|
33
34
|
|
|
34
35
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: graxpert
|
|
3
|
-
Version: 3.2.0a0.
|
|
3
|
+
Version: 3.2.0a0.dev8
|
|
4
4
|
Summary: GraXpert is an astronomical image processing program for extracting and removing gradients in the background of your astrophotos
|
|
5
5
|
Home-page: https://graxpert.com
|
|
6
6
|
Author: GraXpert Development Team
|
|
@@ -15,6 +15,7 @@ Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
|
15
15
|
Classifier: Topic :: Multimedia :: Graphics :: Editors
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
19
|
Classifier: Operating System :: Microsoft :: Windows
|
|
19
20
|
Classifier: Operating System :: MacOS
|
|
20
21
|
Classifier: Operating System :: POSIX :: Linux
|
|
@@ -28,17 +29,17 @@ Description-Content-Type: text/markdown
|
|
|
28
29
|
Requires-Dist: ml-dtypes>=0.5.3
|
|
29
30
|
Requires-Dist: pillow>=11.3.0
|
|
30
31
|
Requires-Dist: appdirs
|
|
31
|
-
Requires-Dist: astropy>=6.1
|
|
32
|
+
Requires-Dist: astropy>=6.0.1
|
|
32
33
|
Requires-Dist: astropy-iers-data>=0.2025.9.1.0.42.11
|
|
33
34
|
Requires-Dist: customtkinter>=5.2.2
|
|
34
35
|
Requires-Dist: imageio>=2.37.0
|
|
35
36
|
Requires-Dist: minio>=7.2.16
|
|
36
|
-
Requires-Dist: numpy
|
|
37
|
+
Requires-Dist: numpy<=2.2.6,>=2.0.2
|
|
37
38
|
Requires-Dist: opencv-python-headless==4.11.0.86
|
|
38
39
|
Requires-Dist: PyKrige>=1.7.2
|
|
39
40
|
Requires-Dist: requests>=2.32.5
|
|
40
|
-
Requires-Dist: scikit-image>=0.
|
|
41
|
-
Requires-Dist: scipy>=1.
|
|
41
|
+
Requires-Dist: scikit-image>=0.24.0
|
|
42
|
+
Requires-Dist: scipy>=1.13.1
|
|
42
43
|
Requires-Dist: xisf>=0.9.5
|
|
43
44
|
Provides-Extra: cuda
|
|
44
45
|
Requires-Dist: onnxruntime-gpu[cuda,cudnn]==1.22.0; extra == "cuda"
|
|
@@ -95,17 +96,29 @@ We do this via the the python [pypi.org](https://pypi.org/project/graxpert/) rep
|
|
|
95
96
|
1. Install [python](https://www.python.org/downloads/) runtime for your OS. The default install should automatically include the python package manager 'pip'.
|
|
96
97
|
2. At a shell prompt type the correct flavor of graxpert to install for your needs.
|
|
97
98
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
* **pip install graxpert\[cpuonly\]** - Use this if you are on OS-X - it is poorly named, but it will still use the CoreML Apple GPU support
|
|
99
|
+
* **brew install pipx python-tk@3.13; pipx install --python python3.13 graxpert\\\[cpuonly\\\]** - Use this if you are on OS-X - it is poorly named, but it will still use the CoreML Apple GPU support
|
|
101
100
|
* **pip install graxpert\[cuda\]** - Use this if you have an Nvidia GPU
|
|
102
|
-
* **pip install graxpert\[rocm\]** - Use this if you have an AMD GPU
|
|
101
|
+
* **pip install graxpert\[rocm\]** --pip-args="-f https://repo.radeon.com/rocm/manylinux/rocm-rel-7.0/" - Use this if you have an AMD GPU
|
|
103
102
|
* **pip install graxpert\[openvino\]** - Use this if you don't have an advanced GPU or don't know what you have (provides sizable acceleration on most modern Intel CPUs)
|
|
104
103
|
* **pip install graxpert\[directml\]** - Use this if you want the Windows DirectML acceleration (not as fast as the options above but widely supported and easy to install)
|
|
105
104
|
* **pip install graxpert\[cpuonly\]** - If you encounter bugs with any of our GPU versions, please file a bug and temporarily use this version (which excludes all GPU code)
|
|
106
105
|
|
|
107
106
|
If you are an advanced python user and know about the 'pipx' tool, we recommend that you use that tool instead of pip for installs.
|
|
108
107
|
|
|
108
|
+
## AMD GPU library installation
|
|
109
|
+
|
|
110
|
+
If you are using an AMD GPU and the python packages above, you'll probably need to install the latest AMD GPU software.
|
|
111
|
+
|
|
112
|
+
For Ubuntu linux the instructions run:
|
|
113
|
+
```
|
|
114
|
+
wget https://repo.radeon.com/amdgpu-install/7.0.1/ubuntu/noble/amdgpu-install_7.0.1.70001-1_all.deb
|
|
115
|
+
sudo apt install ./amdgpu-install_7.0.1.70001-1_all.deb
|
|
116
|
+
sudo apt update
|
|
117
|
+
sudo apt install rocm python3-tk
|
|
118
|
+
sudo usermod -a -G render,video $LOGNAME # Add the current user to the render and video groups
|
|
119
|
+
```
|
|
120
|
+
For other OSes see the instructions [here](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html).
|
|
121
|
+
|
|
109
122
|
# Legacy Installation
|
|
110
123
|
You can download the latest official release of GraXpert [here](https://github.com/Steffenhir/GraXpert/releases/latest). Select the correct version for your operating system. For macOS, we provide different versions
|
|
111
124
|
for Intel processors (x86_64) and for apple silicon (arm64).
|
|
@@ -200,7 +213,7 @@ For macOS, we have to install tkinter separately.
|
|
|
200
213
|
We use the version provided by brew because it is newer
|
|
201
214
|
and solves issues with macOS Sonoma. Please use the version matching with your Python version.
|
|
202
215
|
"""
|
|
203
|
-
brew install python-tk
|
|
216
|
+
brew install python-tk
|
|
204
217
|
```
|
|
205
218
|
|
|
206
219
|
## Option 2: Automatic setup with devcontainers
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
ml-dtypes>=0.5.3
|
|
2
2
|
pillow>=11.3.0
|
|
3
3
|
appdirs
|
|
4
|
-
astropy>=6.1
|
|
4
|
+
astropy>=6.0.1
|
|
5
5
|
astropy-iers-data>=0.2025.9.1.0.42.11
|
|
6
6
|
customtkinter>=5.2.2
|
|
7
7
|
imageio>=2.37.0
|
|
8
8
|
minio>=7.2.16
|
|
9
|
-
numpy
|
|
9
|
+
numpy<=2.2.6,>=2.0.2
|
|
10
10
|
opencv-python-headless==4.11.0.86
|
|
11
11
|
PyKrige>=1.7.2
|
|
12
12
|
requests>=2.32.5
|
|
13
|
-
scikit-image>=0.
|
|
14
|
-
scipy>=1.
|
|
13
|
+
scikit-image>=0.24.0
|
|
14
|
+
scipy>=1.13.1
|
|
15
15
|
xisf>=0.9.5
|
|
16
16
|
|
|
17
17
|
[cpuonly]
|
|
@@ -11,9 +11,9 @@ archs = ["auto64"]
|
|
|
11
11
|
requires = [
|
|
12
12
|
"setuptools>=80.9.0",
|
|
13
13
|
"wheel>=0.45.1",
|
|
14
|
-
"astropy>=
|
|
14
|
+
"astropy>=6.0.1",
|
|
15
15
|
"cx_Freeze>=8.4.0",
|
|
16
16
|
"imageio>=2.37.0",
|
|
17
|
-
"scikit-image>=0.
|
|
17
|
+
"scikit-image>=0.24.0"
|
|
18
18
|
]
|
|
19
19
|
build-backend = "setuptools.build_meta"
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
ml-dtypes>=0.5.3
|
|
2
2
|
pillow>=11.3.0
|
|
3
3
|
appdirs
|
|
4
|
-
astropy>=6.1
|
|
4
|
+
astropy>=6.0.1
|
|
5
5
|
astropy-iers-data>=0.2025.9.1.0.42.11
|
|
6
6
|
customtkinter>=5.2.2
|
|
7
7
|
imageio>=2.37.0
|
|
8
8
|
minio>=7.2.16
|
|
9
|
-
numpy
|
|
9
|
+
numpy>=2.0.2,<=2.2.6
|
|
10
10
|
opencv-python-headless==4.11.0.86
|
|
11
11
|
PyKrige>=1.7.2
|
|
12
12
|
requests>=2.32.5
|
|
13
|
-
scikit-image>=0.
|
|
14
|
-
scipy>=1.
|
|
13
|
+
scikit-image>=0.24.0
|
|
14
|
+
scipy>=1.13.1
|
|
15
15
|
xisf>=0.9.5
|
|
@@ -109,6 +109,7 @@ setup_options = {
|
|
|
109
109
|
# Supported Python versions: List all versions you test against.
|
|
110
110
|
"Programming Language :: Python :: 3.11",
|
|
111
111
|
"Programming Language :: Python :: 3.12",
|
|
112
|
+
"Programming Language :: Python :: 3.13",
|
|
112
113
|
|
|
113
114
|
# Operating System: Specify which OSs are supported.
|
|
114
115
|
"Operating System :: Microsoft :: Windows",
|
|
@@ -128,7 +129,9 @@ setup_options = {
|
|
|
128
129
|
|
|
129
130
|
# We are careful to manually select which onnxruntime version we want based on target architecture
|
|
130
131
|
# also exclude build time only tools
|
|
131
|
-
|
|
132
|
+
# we can't exclude tests because that apparently breaks runtime numpy for the windows msi build
|
|
133
|
+
# exclude=["tests"]
|
|
134
|
+
packages = setuptools.find_packages()
|
|
132
135
|
print(f"Including the following packages: {packages}")
|
|
133
136
|
|
|
134
137
|
# import cx_Freeze only when needed
|
|
@@ -206,15 +209,17 @@ if cx_freeze_commands.intersection(sys.argv):
|
|
|
206
209
|
|
|
207
210
|
# for exe builds we are careful to include the correct onnxruntime
|
|
208
211
|
if sys.platform == "win32":
|
|
209
|
-
|
|
210
|
-
#
|
|
212
|
+
pass
|
|
213
|
+
# on windows we default to whatever onnx lib was installed at build time
|
|
214
|
+
# build_options["excludes"] += ["onnxruntime", "onnxruntime-rocm", "onnxruntime-gpu"]
|
|
211
215
|
# build_options["includes"] += ["onnxruntime-directml"]
|
|
212
216
|
else:
|
|
213
217
|
build_options["excludes"] += ["onnxruntime-gpu", "onnxruntime-rocm", "onnxruntime-directml"]
|
|
214
218
|
build_options["includes"] += ["onnxruntime"]
|
|
215
219
|
|
|
216
220
|
# console allows passing in command line
|
|
217
|
-
base = "
|
|
221
|
+
base = "gui" if sys.platform == "win32" else "console"
|
|
222
|
+
# base = "console" # if debugging on windows (or trying to use the exe in a script, then this is probably better)
|
|
218
223
|
|
|
219
224
|
executables = [cx_Freeze.Executable("./graxpert/main.py", base=base,
|
|
220
225
|
icon="./img/Icon", # leave off extension so it will be autocorrected for any OS
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/img/GraXpert_LOGO_Hauptvariante.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graxpert-3.2.0a0.dev6 → graxpert-3.2.0a0.dev8}/graxpert/img/graXpert_Startbadge_Umbriel.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|