{"id":13688981,"url":"https://github.com/google-deepmind/dm_pix","last_synced_at":"2025-06-17T00:39:40.033Z","repository":{"id":39620333,"uuid":"381765733","full_name":"google-deepmind/dm_pix","owner":"google-deepmind","description":"PIX is an image processing library in JAX, for JAX.","archived":false,"fork":false,"pushed_at":"2025-03-06T03:24:32.000Z","size":779,"stargazers_count":415,"open_issues_count":1,"forks_count":29,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-01T20:37:13.915Z","etag":null,"topics":["computer-vision","image","image-processing","jax","machine-learning","python"],"latest_commit_sha":null,"homepage":"https://dm-pix.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google-deepmind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-06-30T16:25:50.000Z","updated_at":"2025-04-24T10:35:55.000Z","dependencies_parsed_at":"2023-09-07T20:34:50.733Z","dependency_job_id":"21b9fea6-f267-41e8-a47e-314458e3911e","html_url":"https://github.com/google-deepmind/dm_pix","commit_stats":null,"previous_names":["google-deepmind/dm_pix","deepmind/dm_pix"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/google-deepmind/dm_pix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-deepmind%2Fdm_pix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-deepmind%2Fdm_pix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-deepmind%2Fdm_pix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-deepmind%2Fdm_pix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google-deepmind","download_url":"https://codeload.github.com/google-deepmind/dm_pix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-deepmind%2Fdm_pix/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260268635,"owners_count":22983601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","image","image-processing","jax","machine-learning","python"],"created_at":"2024-08-02T15:01:29.528Z","updated_at":"2025-06-17T00:39:40.025Z","avatar_url":"https://github.com/google-deepmind.png","language":"Python","readme":"# PIX\n\n\u003cimg src=\"https://raw.githubusercontent.com/google-deepmind/dm_pix/master/dm_pix/images/pix_logo.png\" title=\"PIX logo\" height=200 width=200\u003e\n\nPIX is an image processing library in [JAX], for [JAX].\n\n[![GitHub Workflow CI](https://img.shields.io/github/actions/workflow/status/deepmind/dm_pix/ci.yml?label=pytest\u0026logo=python\u0026logoColor=white\u0026style=flat-square)](https://github.com/deepmind/dm_pix/actions/workflows/ci.yml)\n[![Read the Docs](https://img.shields.io/readthedocs/dm_pix?label=ReadTheDocs\u0026logo=readthedocs\u0026logoColor=white\u0026style=flat-square)](https://dm-pix.readthedocs.io/en/latest/?badge=latest)\n[![PyPI](https://img.shields.io/pypi/v/dm_pix?logo=pypi\u0026logoColor=white\u0026style=flat-square)](https://pypi.org/project/dm-pix/)\n\n## Overview\n\n[JAX] is a library resulting from the union of [Autograd] and [XLA] for\nhigh-performance machine learning research. It provides [NumPy], [SciPy],\nautomatic differentiation and first-class GPU/TPU support.\n\nPIX is a library built on top of JAX with the goal of providing image processing\nfunctions and tools to JAX in a way that they can be optimised and parallelised\nthrough [`jax.jit`][jit], [`jax.vmap`][vmap] and [`jax.pmap`][pmap].\n\n## Installation\n\nPIX is written in pure Python, but depends on C++ code via JAX.\n\nBecause JAX installation is different depending on your CUDA version, PIX does\nnot list JAX as a dependency in [`pyproject.toml`], although it is technically\nlisted for reference, but commented.\n\nFirst, follow [JAX installation instructions] to install JAX with the relevant\naccelerator support.\n\nThen, install PIX using `pip`:\n\n```bash\n$ pip install dm-pix\n```\n\n## Quickstart\n\nTo use `PIX`, you just need to `import dm_pix as pix` and use it right away!\n\nFor example, let's assume to have loaded the JAX logo (available in\n`examples/assets/jax_logo.jpg`) in a variable called `image` and we want to flip\nit left to right.\n\n![JAX logo]\n\nAll it's needed is the following code!\n\n```python\nimport dm_pix as pix\n\n# Load an image into a NumPy array with your preferred library.\nimage = load_image()\n\nflip_left_right_image = pix.flip_left_right(image)\n```\n\nAnd here is the result!\n\n![JAX logo left-right]\n\nAll the functions in PIX can be [`jax.jit`][jit]ed, [`jax.vmap`][vmap]ed and\n[`jax.pmap`][pmap]ed, so all the following functions can take advantage of\noptimization and parallelization.\n\n```python\nimport dm_pix as pix\nimport jax\n\n# Load an image into a NumPy array with your preferred library.\nimage = load_image()\n\n# Vanilla Python function.\nflip_left_right_image = pix.flip_left_right(image)\n\n# `jax.jit`ed function.\nflip_left_right_image = jax.jit(pix.flip_left_right)(image)\n\n# Assuming to have a single device, like a CPU or a single GPU, we add a\n# single leading dimension for using `image` with the parallelized or\n# the multi-device parallelization version of `pix.flip_left_right`.\n# To know more, please refer to JAX documentation of `jax.vmap` and `jax.pmap`.\nimage = image[np.newaxis, ...]\n\n# `jax.vmap`ed function.\nflip_left_right_image = jax.vmap(pix.flip_left_right)(image)\n\n# `jax.pmap`ed function.\nflip_left_right_image = jax.pmap(pix.flip_left_right)(image)\n```\n\nYou can check it yourself that the result from the four versions of\n`pix.flip_left_right` is the same (up to the accelerator floating point\naccuracy)!\n\n## Examples\n\nWe have a few examples in the [`examples/`] folder. They are not much\nmore involved then the previous example, but they may be a good starting point\nfor you!\n\n## Testing\n\nWe provide a suite of tests to help you both testing your development\nenvironment and to know more about the library itself! All test files have\n`_test` suffix, and can be executed using `pytest`.\n\nIf you already have PIX installed, you just need to install some extra\ndependencies and run `pytest` as follows:\n\n```bash\n$ pip install -e \".[test]\"\n$ python -m pytest [-n \u003cNUMCPUS\u003e] dm_pix\n```\n\nIf you want an isolated virtual environment, you just need to run our utility\n`bash` script as follows:\n\n```bash\n$ ./test.sh\n```\n\n## Citing PIX\n\nThis repository is part of the [DeepMind JAX Ecosystem], to cite PIX please use\nthe [DeepMind JAX Ecosystem citation].\n\n## Contribute!\n\nWe are very happy to accept contributions!\n\nPlease read our [contributing guidelines](./CONTRIBUTING.md) and send us PRs!\n\n[Autograd]: https://github.com/hips/autograd \"Autograd on GitHub\"\n[DeepMind JAX Ecosystem]: https://deepmind.com/blog/article/using-jax-to-accelerate-our-research \"DeepMind JAX Ecosystem\"\n[DeepMind JAX Ecosystem citation]: https://github.com/deepmind/jax/blob/main/deepmind2020jax.txt \"Citation\"\n[JAX]: https://github.com/jax-ml/jax \"JAX on GitHub\"\n[JAX installation instructions]: https://github.com/jax-ml/jax#installation \"JAX installation\"\n[jit]: https://jax.readthedocs.io/en/latest/jax.html#jax.jit \"jax.jit documentation\"\n[NumPy]: https://numpy.org/ \"NumPy\"\n[pmap]: https://jax.readthedocs.io/en/latest/jax.html#jax.pmap \"jax.pmap documentation\"\n[SciPy]: https://www.scipy.org/ \"SciPy\"\n[XLA]: https://www.tensorflow.org/xla \"XLA\"\n[vmap]: https://jax.readthedocs.io/en/latest/jax.html#jax.vmap \"jax.vmap documentation\"\n\n[`examples/`]: ./examples/\n[JAX logo]: ./examples/assets/jax_logo.jpg\n[JAX logo left-right]: ./examples/assets/flip_left_right_jax_logo.jpg\n[`pyproject.toml`]: ./pyproject.toml\n","funding_links":[],"categories":["Python","Libraries"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle-deepmind%2Fdm_pix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle-deepmind%2Fdm_pix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle-deepmind%2Fdm_pix/lists"}