graxpert 3.2.0a0.dev5__tar.gz → 3.2.0a0.dev7__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.
Files changed (84) hide show
  1. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/PKG-INFO +18 -6
  2. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/README.md +17 -5
  3. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/ai_model_handling.py +37 -0
  4. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/background_extraction.py +4 -9
  5. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/deconvolution.py +6 -10
  6. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/denoising.py +4 -9
  7. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/main.py +2 -1
  8. graxpert-3.2.0a0.dev7/graxpert/version.py +2 -0
  9. graxpert-3.2.0a0.dev7/graxpert/version.py.bak +2 -0
  10. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert.egg-info/PKG-INFO +18 -6
  11. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert.egg-info/top_level.txt +1 -0
  12. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/setup.py +3 -1
  13. graxpert-3.2.0a0.dev5/graxpert/version.py +0 -2
  14. graxpert-3.2.0a0.dev5/graxpert/version.py.bak +0 -2
  15. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/MANIFEST.in +0 -0
  16. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/AstroImageRepository.py +0 -0
  17. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/__init__.py +0 -0
  18. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/app_state.py +0 -0
  19. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/application/__init__.py +0 -0
  20. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/application/app.py +0 -0
  21. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/application/app_events.py +0 -0
  22. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/application/eventbus.py +0 -0
  23. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/astroimage.py +0 -0
  24. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/background_flood_selection.py +0 -0
  25. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/background_grid_selection.py +0 -0
  26. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/cmdline_tools.py +0 -0
  27. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/commands.py +0 -0
  28. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/grid_utils.py +0 -0
  29. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/img/GraXpert_LOGO_Hauptvariante.png +0 -0
  30. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/img/Icon.png +0 -0
  31. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/img/LDN1235_original.jpg +0 -0
  32. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/img/LDN1235_processed.jpg +0 -0
  33. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/img/__init__.py +0 -0
  34. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/img/gfx_numbers.png +0 -0
  35. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/img/gfx_numbers.svg +0 -0
  36. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/img/graXpert_Startbadge_Umbriel.png +0 -0
  37. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/img/hourglass.png +0 -0
  38. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/locales/__init__.py +0 -0
  39. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/locales/base.pot +0 -0
  40. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/locales/de_DE/LC_MESSAGES/base.mo +0 -0
  41. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/locales/de_DE/LC_MESSAGES/base.po +0 -0
  42. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/localization.py +0 -0
  43. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/mp_logging.py +0 -0
  44. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/parallel_processing.py +0 -0
  45. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/preferences.py +0 -0
  46. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/radialbasisinterpolation.py +0 -0
  47. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/resource_utils.py +0 -0
  48. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/s3_secrets.py +0 -0
  49. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/skyall.py +0 -0
  50. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/stretch.py +0 -0
  51. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/theme/__init__.py +0 -0
  52. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/theme/graxpert-dark-blue.json +0 -0
  53. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/ui/__init__.py +0 -0
  54. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/ui/application_frame.py +0 -0
  55. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/ui/canvas.py +0 -0
  56. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/ui/left_menu.py +0 -0
  57. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/ui/loadingframe.py +0 -0
  58. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/ui/right_menu.py +0 -0
  59. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/ui/statusbar.py +0 -0
  60. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/ui/styling.py +0 -0
  61. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/ui/tooltip.py +0 -0
  62. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/ui/ui_events.py +0 -0
  63. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/ui/widgets.py +0 -0
  64. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert/ui_scaling.py +0 -0
  65. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert.egg-info/SOURCES.txt +0 -0
  66. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert.egg-info/dependency_links.txt +0 -0
  67. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert.egg-info/entry_points.txt +0 -0
  68. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/graxpert.egg-info/requires.txt +0 -0
  69. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/img/Icon.icns +0 -0
  70. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/img/Icon.ico +0 -0
  71. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/img/Icon.png +0 -0
  72. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/img/NGC7000_original.jpg +0 -0
  73. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/img/NGC7000_processed.jpg +0 -0
  74. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/img/graXpert_Startbadge_Ariel.png +0 -0
  75. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/img/graXpert_Startbadge_Ariel.svg +0 -0
  76. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/img/graXpert_Startbadge_Dione.png +0 -0
  77. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/img/graXpert_Startbadge_Dione.svg +0 -0
  78. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/img/graXpert_Startbadge_Tethys.png +0 -0
  79. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/img/graXpert_Startbadge_Tethys.svg +0 -0
  80. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/img/graXpert_Startbadge_Umbriel.png +0 -0
  81. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/img/graXpert_Startbadge_Umbriel.svg +0 -0
  82. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/pyproject.toml +0 -0
  83. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/requirements.txt +0 -0
  84. {graxpert-3.2.0a0.dev5 → graxpert-3.2.0a0.dev7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graxpert
3
- Version: 3.2.0a0.dev5
3
+ Version: 3.2.0a0.dev7
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
@@ -95,17 +95,29 @@ We do this via the the python [pypi.org](https://pypi.org/project/graxpert/) rep
95
95
  1. Install [python](https://www.python.org/downloads/) runtime for your OS. The default install should automatically include the python package manager 'pip'.
96
96
  2. At a shell prompt type the correct flavor of graxpert to install for your needs.
97
97
 
98
- FIXME, recommend directml for windows, FIXME for linux and FIXME for mac
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
98
+ * **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
99
  * **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
100
+ * **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
101
  * **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
102
  * **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
103
  * **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
104
 
107
105
  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
106
 
107
+ ## AMD GPU library installation
108
+
109
+ If you are using an AMD GPU and the python packages above, you'll probably need to install the latest AMD GPU software.
110
+
111
+ For Ubuntu linux the instructions run:
112
+ ```
113
+ wget https://repo.radeon.com/amdgpu-install/7.0.1/ubuntu/noble/amdgpu-install_7.0.1.70001-1_all.deb
114
+ sudo apt install ./amdgpu-install_7.0.1.70001-1_all.deb
115
+ sudo apt update
116
+ sudo apt install rocm python3-tk
117
+ sudo usermod -a -G render,video $LOGNAME # Add the current user to the render and video groups
118
+ ```
119
+ For other OSes see the instructions [here](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html).
120
+
109
121
  # Legacy Installation
110
122
  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
123
  for Intel processors (x86_64) and for apple silicon (arm64).
@@ -200,7 +212,7 @@ For macOS, we have to install tkinter separately.
200
212
  We use the version provided by brew because it is newer
201
213
  and solves issues with macOS Sonoma. Please use the version matching with your Python version.
202
214
  """
203
- brew install python-tk@3.10
215
+ brew install python-tk
204
216
  ```
205
217
 
206
218
  ## 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
- FIXME, recommend directml for windows, FIXME for linux and FIXME for mac
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@3.10
149
+ brew install python-tk
138
150
  ```
139
151
 
140
152
  ## Option 2: Automatic setup with devcontainers
@@ -213,3 +213,40 @@ def get_execution_providers_ordered(gpu_acceleration=True):
213
213
  "If you are using one of our prebuilt executables, please file a bug with the following information:\n"
214
214
  "{}".format(e))
215
215
  sys.exit(1)
216
+
217
+ # Provides a mutable session context that can swap out different sessions if needed
218
+ class SessionContext:
219
+ model_name: str
220
+ session: any # onnxruntime.InferenceSession
221
+
222
+ def __init__(self, model_name: str, gpu_acceleration: bool = True):
223
+ """Initialize the ONNX model session with the specified execution provider."""
224
+
225
+ providers = get_execution_providers_ordered(gpu_acceleration)
226
+ logging.info(f"Available inference providers : {providers}")
227
+
228
+ import onnxruntime as ort # Must be after get_execution_providers_ordered (so it can check for missing libs)
229
+ self.session = ort.InferenceSession(model_name, providers=providers)
230
+ self.model_name = model_name
231
+
232
+ logging.info(f"Used inference providers for {model_name}: {self.session.get_providers()}")
233
+
234
+
235
+ def run(self, model_args: dict) -> any:
236
+ """Run the ONNX model using the specified execution provider."""
237
+
238
+ providers = self.session.get_providers()
239
+ gpu_acceleration = len(providers) > 1 or providers[0] != "CPUExecutionProvider"
240
+ try:
241
+ result = self.session.run(None, model_args)
242
+ except Exception as e:
243
+ if not gpu_acceleration:
244
+ raise # Rethrow, the failure occurred with the regular CPU model also - show error dialog
245
+
246
+ logging.warning(f"Error running model, falling back to CPU only: {e}")
247
+ import onnxruntime as ort
248
+ self.session = ort.InferenceSession(self.model_name, providers=get_execution_providers_ordered(False))
249
+ result = self.session.run(None, model_args)
250
+
251
+ # all graxpert results are in the first array index
252
+ 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 get_execution_providers_ordered
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
- providers = get_execution_providers_ordered(ai_gpu_acceleration)
73
- import onnxruntime as ort # Must be after get_execution_providers_ordered
74
- session = ort.InferenceSession(ai_path, providers=providers)
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 get_execution_providers_ordered
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
- session_result = session.run(None, {"gen_input_image": input_tiles, "sigma": sigma, "strenght": strenght_p})[0]
127
+ model_args = {"gen_input_image": input_tiles, "sigma": sigma, "strenght": strenght_p}
133
128
  else:
134
- session_result = session.run(None, {"gen_input_image": input_tiles, "params": conds})[0]
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 get_execution_providers_ordered
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 = session.run(None, {"gen_input_image": input_tiles})[0]
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 Windows/OS-X: It should be included with your Python installation by default.", file=sys.stderr)
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
 
@@ -0,0 +1,2 @@
1
+ release = "the github CI DMG builds are not yet reliable, don't require them before pypi publish"
2
+ version = "3.2.0.a0.dev7"
@@ -0,0 +1,2 @@
1
+ release = "the github CI DMG builds are not yet reliable, don't require them before pypi publish"
2
+ version = "SNAPSHOT"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graxpert
3
- Version: 3.2.0a0.dev5
3
+ Version: 3.2.0a0.dev7
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
@@ -95,17 +95,29 @@ We do this via the the python [pypi.org](https://pypi.org/project/graxpert/) rep
95
95
  1. Install [python](https://www.python.org/downloads/) runtime for your OS. The default install should automatically include the python package manager 'pip'.
96
96
  2. At a shell prompt type the correct flavor of graxpert to install for your needs.
97
97
 
98
- FIXME, recommend directml for windows, FIXME for linux and FIXME for mac
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
98
+ * **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
99
  * **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
100
+ * **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
101
  * **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
102
  * **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
103
  * **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
104
 
107
105
  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
106
 
107
+ ## AMD GPU library installation
108
+
109
+ If you are using an AMD GPU and the python packages above, you'll probably need to install the latest AMD GPU software.
110
+
111
+ For Ubuntu linux the instructions run:
112
+ ```
113
+ wget https://repo.radeon.com/amdgpu-install/7.0.1/ubuntu/noble/amdgpu-install_7.0.1.70001-1_all.deb
114
+ sudo apt install ./amdgpu-install_7.0.1.70001-1_all.deb
115
+ sudo apt update
116
+ sudo apt install rocm python3-tk
117
+ sudo usermod -a -G render,video $LOGNAME # Add the current user to the render and video groups
118
+ ```
119
+ For other OSes see the instructions [here](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html).
120
+
109
121
  # Legacy Installation
110
122
  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
123
  for Intel processors (x86_64) and for apple silicon (arm64).
@@ -200,7 +212,7 @@ For macOS, we have to install tkinter separately.
200
212
  We use the version provided by brew because it is newer
201
213
  and solves issues with macOS Sonoma. Please use the version matching with your Python version.
202
214
  """
203
- brew install python-tk@3.10
215
+ brew install python-tk
204
216
  ```
205
217
 
206
218
  ## Option 2: Automatic setup with devcontainers
@@ -128,7 +128,9 @@ setup_options = {
128
128
 
129
129
  # We are careful to manually select which onnxruntime version we want based on target architecture
130
130
  # also exclude build time only tools
131
- packages = setuptools.find_packages(exclude=["tests"])
131
+ # we can't exclude tests because that apparently breaks runtime numpy for the windows msi build
132
+ # exclude=["tests"]
133
+ packages = setuptools.find_packages()
132
134
  print(f"Including the following packages: {packages}")
133
135
 
134
136
  # import cx_Freeze only when needed
@@ -1,2 +0,0 @@
1
- release = "test pypi based builds on release generation"
2
- version = "3.2.0.a0.dev5"
@@ -1,2 +0,0 @@
1
- release = "test pypi based builds on release generation"
2
- version = "SNAPSHOT"