Quickstart ========= This guide will help you get started with AstroPT quickly. Loading a pre-trained model -------------------------- To load and run a pre-trained AstroPT model from Hugging Face 🤗, use the ``load_astropt`` function: .. code-block:: python from astropt.model_utils import load_astropt model, model_args = load_astropt( repo_id="smith42/astropt_sparse", path="astropt/p16k10", weights_filename="ckpt.pt", ) model = model.to("cuda") # Move to GPU if available Available pre-trained models -------------------------- Below are some pre-trained models you can load with the code snippet above: **DESI Legacy Survey Model** - **Modalities:** JPG galaxy imagery - **AstroPT version:** v1.0.0 - **Model weights:** `AstroPT `_ - **Dataset:** `Galaxies Dataset `_ - **Paper:** `arXiv:2405.14930 `_ **DESI Legacy Survey Model (v2.0)** - **Modalities:** JPG galaxy imagery (cropped and zoomed) - **AstroPT version:** v2.0.4 - **Model weights:** `AstroPT v2.0 `_ - **Dataset:** `Galaxies Dataset `_ - **Paper:** `arXiv:2405.14930 `_ **Euclid Model** - **Modalities:** FITS VIS, NISP galaxy imagery and SED data - **AstroPT version:** v1.0.2 - **Model weights:** `AstroPT-Euclid `_ - **Dataset:** `Euclid Training Dataset `_ - **Paper:** `arXiv:2503.15312 `_ Basic model usage --------------- Here's a simple example of how to use the model for inference: .. code-block:: python import torch from astropt.model_utils import load_astropt # Load the model model, model_args = load_astropt( repo_id="smith42/astropt_sparse", path="astropt/p16k10", weights_filename="ckpt.pt", ) model = model.to("cuda") # Prepare your input data # This is a simplified example - actual preprocessing depends on your data input_data = preprocess_your_data(your_data) # Convert to tensor and move to the same device as the model input_tensor = torch.tensor(input_data).to("cuda") # Run inference with torch.no_grad(): output = model(input_tensor) # Process the output processed_output = process_output(output)