17 dic 2025

cc-build



Provisional only. I'll check and tidy this later... PROMISE 



Beg/borrow/steal the latest source you can can lay your hands on; ask Franklin, scour github, the seti Discord.,.. Or, do what I did, at least to get started...

git clone https://github.com/setiastro/cosmicclarity.git
cd cosmicclarity
python3.12 -m venv venv

. venv/bin/activate
pip install -r requirements.txt

At this point, you'll see how old the git really is! So...
pip install pyinstaller xisf pyqt6 opencv-python-headless sep onnxruntime scikit-image lazy-loader requests numba py-cpuinfo gpuinfo psutil

You'll also need the test image benchmarkimage.fit
I put a copy here:

https://drive.google.com/file/d/1VhsUYqSzGTgyjdXtxQ6KNv6V7uYq4dZa/view?usp=sharing

Place it and benchmark.png in the main _internal directory
You also need:
 deep_sharp_stellar_cnn_AI3_5.pth
I just downloaded a standard cc folder, placed my binaries and _internal to replace the existing and:
cp 
deep_sharp_stellar_cnn_AI3_5s.pth deep_sharp_stellar_cnn_AI3_5.pth
and 
cp 
deep_sharp_stellar_cnn_AI3_5s.onnx deep_sharp_stellar_cnn_AI3_5.onnx


 build

pyinstaller --copy-metadata xisf setiastrocosmicclarity_darkstar.py
pyinstaller --copy-metadata xisf SetiAstroCosmicClarity.py pyinstaller --copy-metadata xisf SetiAstroCosmicClarity_denoise.py pyinstaller --copy-metadata xisf SetiAstroCosmicClarity_satellite.py

the _internal folder

When the .py has been built, your binary appears at e.g. dist/SetiAstroCosmicClarity/SetiAstroCosmicClarity Copy the _internal folder to the main directory along with the SetiAstroCosmicClarity binary. After the build of each module, copy the binary to the main folder and merge the respective _internal

--- --- ---

binary names
SASPro expects the following names for the binaries:
setiastrocosmicclarity_darkstar
SetiAstroCosmicClarity
SetiAstroCosmicClarity_denoise
setiastrocosmicclarity_satellite

(Note to self to check case of the names and for setastrocosmicclarity__superres)

Rename as necessary. For example:
 cp -a setiastrocosmicclaritylinux SetiAstroCosmicClarity

build isues
 getting sep recognised
copy
sep.cpython-312-x86_64-linux-gnu.so
from cosmicclarity/venv/lib64/python3.12/site-packages
to the
_internal folder in the main directory

satellite 
If you're doing this manually rather than merging the _internal directories...
From the dist/SetiAstroCosmicClarity_satellitelinux/_internal 
folder, copy these:
lazy_loader
lazy_loader-0.4.dist-info 
rawpy
rawpy-0.25.1.dist-info
rawpy.libs
scikit_image-0.25.2.dist-info
scipy
scipy-1.16.3.dist-info
scipy.libs
skimage

to the _internal folder in the main directory

the ai  onnx and  pth files
Make  a new folder  to contain the binaries and  the  ai stuff. An  easy way to do this is  to  download the  current  cc  from the  setiastro site  and simply replace  the  binaries with the  ones you built AND  of  course the  _internal along with it.
 --- --- ---

.spec file to build Thanks to the setiastro discord, we now have a .spec file which builds all the binaries. Make a venv, install the requirements.txt and the other stuff listed above and pyinstaller master.spec https://discord.com/channels/1257377319765413961/1452498766757368001



This will build ALL the cc modules, not just the ones I -selfishly- needed- The binaries and _internal folder created under dist are then dropped into an existing folder with containing the pth and onnx files. An easy way to do this is to download the pre built cosmic clarity_linux and overwrite the respective files therein with your build. Much more elegant than my brute force and ignorance method...


EDIT: After update, python gives the wrong path. We need pip3.12 so instead of typing 3.12 each time we can... ((venv) ) steve@cocina2:~/Desktop/cc3-build-dev$ rm pip pip3 ln -s pip3.12 pip

No hay comentarios:

Publicar un comentario