Metadata-Version: 2.4
Name: nebulae
Version: 0.6.29
Summary: A deep learning framework based on PyTorch and prevalent image processing libraries. It aims to offer a set of useful tools and functions.
Author-email: Seria <zzqsummerai@yeah.net>
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tcurve
Requires-Dist: h5py
Requires-Dist: pyyaml
Requires-Dist: pillow
Requires-Dist: numpy
Requires-Dist: piexif
Requires-Dist: scipy
Requires-Dist: onnx
Requires-Dist: torch>=1.0
Requires-Dist: torchvision
Requires-Dist: ptflops>0.6.7
Dynamic: license-file

<p align="center">
  <img src="https://s4.ax1x.com/2022/01/03/THE0u6.png" alt="nebulae-icon.png" width = "128" height = "128" />
</p>


<h1 align="center">Nebulae</h1>

<p align="center">
  <b> A deep learning framework based on PyTorch and prevalent image processing libraries </b><br>
  It aims to offer a set of useful tools and functions.
</p>


<p align="center">
  <img src="https://img.shields.io/pypi/v/nebulae?color=blue&label=Version" alt="Version">
  <img src="https://img.shields.io/github/stars/SeriaQ/Nebulae?style=social" alt="GitHub Repo Stars">
  <img src="https://img.shields.io/badge/Made%20with-Python-blue" alt="Python">
  <img src="https://img.shields.io/badge/License-MIT-green" alt="MIT License">
</p>


------

## 🚀 Spotlight

Several frequently used features are integrated with simple interfaces.

🛠️ **Integrated Feats** - EMA module, multi-source datasets, training log plotting and timer etc.

🎯 **Simplified API** - Unified API for distributed and single-GPU training.

⚡️ **Efficiency** - Data augmentations are reimplemented using Numpy which is faster than PIL.

🧩 **High Compatibility** - Users are able to build networks using Nebulae with PyTorch seamlessly.

------

## ⚡ Quick Start

📸 **Utility**

Obtain GPU stats after some training epochs.

```python
import nebulae as neb
from nebulae import *

gu = kit.GPUtil()
gu.monitor()
for epoch in range(10):
  # --- training code --- #
gu.status()
```

[![OSFsSD.jpg](https://ooo.0x0.ooo/2025/03/16/OSFsSD.jpg)](https://img.tg/image/OSFsSD)



Automatically select unoccupied GPUs. It is useful for a shared machine. 

```python
import nebulae as neb
from nebulae import *
# select 4 GPUs with 2GB or more memory left
engine = npe(device=power.GPU, ngpu=4, least_mem=2048)
```



Find entire distributed training and test code in ./examples/demo_core.py

------

## 📦 Installation

Users can install nebulae from pip

```sh
pip install nebulae
```

For local development, use uv with the committed `uv.lock` and Python 3.12.11:

```sh
export UV_CACHE_DIR=/root/proj/.uv-cache
export UV_LINK_MODE=hardlink
uv sync --locked
uv run --locked python -c "import nebulae; print(nebulae.__file__)"
```

The same cache and link settings are configured in `pyproject.toml`. The project is
installed in editable mode in `.venv`; source changes take effect immediately.
The lock preserves the existing dependency versions and PyTorch CUDA 12.8 builds.
OpenCV and PyAV are included in the default development group, matching the existing environment.
The uv resolution targets Python 3.12 without changing the published Python support metadata.
Commit `pyproject.toml`, `uv.lock`, and `.python-version`; do not commit `.venv`.
On this machine, use `uv sync --locked --reinstall` if an existing environment needs
to be relinked to the shared cache. Host-side builds and publishing can continue
using the existing workflow.

For better development, building from Dockerfile is also available. Modifying the libs version and have nvidia-docker on your machine is recommended.

```sh
sudo docker build -t nebulae:std -f Dockerfile.std .
sudo docker run -it --gpus all --ipc=host --ulimit memlock=-1 nebulae:std
```

The latest version supports PyTorch1.6 and above

------

## ❤️ Support

If you find Nebulae helpful, consider giving it a ⭐ on GitHub! ▶️ https://github.com/SeriaQ/Nebulae
