https://github.com/google-deepmind/dm_pix

PIX is an image processing library in JAX, for JAX.

https://github.com/google-deepmind/dm_pix

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 17 committers (11.8%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.3%) to scientific vocabulary

Keywords

computer-vision image image-processing jax machine-learning python

Keywords from Contributors

transformers distribution research archival embedded profiles projection deep-neural-networks investing sequences
Last synced: 4 months ago · JSON representation

Repository

PIX is an image processing library in JAX, for JAX.

Basic Info
  • Host: GitHub
  • Owner: google-deepmind
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Homepage: https://dm-pix.readthedocs.io
  • Size: 761 KB
Statistics
  • Stars: 417
  • Watchers: 9
  • Forks: 28
  • Open Issues: 1
  • Releases: 0
Topics
computer-vision image image-processing jax machine-learning python
Created over 4 years ago · Last pushed 12 months ago
Metadata Files
Readme Contributing License

README.md

PIX

PIX is an image processing library in JAX, for JAX.

GitHub Workflow CI Read the Docs PyPI

Overview

JAX is a library resulting from the union of Autograd and XLA for high-performance machine learning research. It provides NumPy, SciPy, automatic differentiation and first-class GPU/TPU support.

PIX is a library built on top of JAX with the goal of providing image processing functions and tools to JAX in a way that they can be optimised and parallelised through jax.jit, jax.vmap and jax.pmap.

Installation

PIX is written in pure Python, but depends on C++ code via JAX.

Because JAX installation is different depending on your CUDA version, PIX does not list JAX as a dependency in pyproject.toml, although it is technically listed for reference, but commented.

First, follow JAX installation instructions to install JAX with the relevant accelerator support.

Then, install PIX using pip:

bash $ pip install dm-pix

Quickstart

To use PIX, you just need to import dm_pix as pix and use it right away!

For example, let's assume to have loaded the JAX logo (available in examples/assets/jax_logo.jpg) in a variable called image and we want to flip it left to right.

JAX logo

All it's needed is the following code!

```python import dm_pix as pix

Load an image into a NumPy array with your preferred library.

image = load_image()

flipleftrightimage = pix.flipleft_right(image) ```

And here is the result!

JAX logo left-right

All the functions in PIX can be jax.jited, jax.vmaped and jax.pmaped, so all the following functions can take advantage of optimization and parallelization.

```python import dm_pix as pix import jax

Load an image into a NumPy array with your preferred library.

image = load_image()

Vanilla Python function.

flipleftrightimage = pix.flipleft_right(image)

jax.jited function.

flipleftrightimage = jax.jit(pix.flipleft_right)(image)

Assuming to have a single device, like a CPU or a single GPU, we add a

single leading dimension for using image with the parallelized or

the multi-device parallelization version of pix.flip_left_right.

To know more, please refer to JAX documentation of jax.vmap and jax.pmap.

image = image[np.newaxis, ...]

jax.vmaped function.

flipleftrightimage = jax.vmap(pix.flipleft_right)(image)

jax.pmaped function.

flipleftrightimage = jax.pmap(pix.flipleft_right)(image) ```

You can check it yourself that the result from the four versions of pix.flip_left_right is the same (up to the accelerator floating point accuracy)!

Examples

We have a few examples in the examples/ folder. They are not much more involved then the previous example, but they may be a good starting point for you!

Testing

We provide a suite of tests to help you both testing your development environment and to know more about the library itself! All test files have _test suffix, and can be executed using pytest.

If you already have PIX installed, you just need to install some extra dependencies and run pytest as follows:

bash $ pip install -e ".[test]" $ python -m pytest [-n <NUMCPUS>] dm_pix

If you want an isolated virtual environment, you just need to run our utility bash script as follows:

bash $ ./test.sh

Citing PIX

This repository is part of the DeepMind JAX Ecosystem, to cite PIX please use the DeepMind JAX Ecosystem citation.

Contribute!

We are very happy to accept contributions!

Please read our contributing guidelines and send us PRs!

Owner

  • Name: Google DeepMind
  • Login: google-deepmind
  • Kind: organization

GitHub Events

Total
  • Create event: 3
  • Issues event: 1
  • Release event: 1
  • Watch event: 37
  • Delete event: 3
  • Issue comment event: 8
  • Push event: 17
  • Pull request event: 6
  • Fork event: 7
Last Year
  • Create event: 3
  • Issues event: 1
  • Release event: 1
  • Watch event: 37
  • Delete event: 3
  • Issue comment event: 8
  • Push event: 17
  • Pull request event: 6
  • Fork event: 7

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 114
  • Total Committers: 17
  • Avg Commits per committer: 6.706
  • Development Distribution Score (DDS): 0.684
Past Year
  • Commits: 12
  • Committers: 5
  • Avg Commits per committer: 2.4
  • Development Distribution Score (DDS): 0.417
Top Committers
Name Email Commits
Claudio Fantacci c****i@g****m 36
Pablo Duque p****e@g****m 23
dependabot[bot] 4****] 9
Saurav Maheshkar s****r@g****m 8
PIXDev p****v@g****m 7
Nathan Simpson n****n@t****k 7
Supreeth Rao 5****9 7
Jon Barron b****n@g****m 4
Jake VanderPlas v****s@g****m 3
Iurii Kemaev i****v@g****m 2
Sebastian Wagner-Carena s****a@g****m 2
Albert Alonso a****o@n****k 1
Jake Harmon j****n@g****m 1
Kian-Meng Ang k****g@c****g 1
Roman Novak r****n@g****m 1
mat kelcey m****y@g****m 1
Álvaro Bartolomé a****t@y****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 5 months ago

All Time
  • Total issues: 11
  • Total pull requests: 101
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 3 days
  • Total issue authors: 11
  • Total pull request authors: 10
  • Average comments per issue: 3.45
  • Average comments per pull request: 0.62
  • Merged pull requests: 60
  • Bot issues: 0
  • Bot pull requests: 90
Past Year
  • Issues: 3
  • Pull requests: 7
  • Average time to close issues: 5 days
  • Average time to close pull requests: 4 days
  • Issue authors: 3
  • Pull request authors: 2
  • Average comments per issue: 2.67
  • Average comments per pull request: 0.86
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 5
Top Authors
Issue Authors
  • smorad (1)
  • mgoulao (1)
  • jakubMitura14 (1)
  • jayendra13 (1)
  • FFLLDDS (1)
  • alonfnt (1)
  • AlbertHuyb (1)
  • jloganolson (1)
  • choltz95 (1)
  • ASEM000 (1)
  • Logon27 (1)
Pull Request Authors
  • copybara-service[bot] (80)
  • dependabot[bot] (10)
  • SauravMaheshkar (2)
  • alvarobartt (2)
  • phinate (2)
  • kianmeng (1)
  • pabloduque0 (1)
  • matpalm (1)
  • SupreethRao99 (1)
  • alonfnt (1)
Top Labels
Issue Labels
question (3) documentation (1) enhancement (1)
Pull Request Labels
cla: yes (15) dependencies (10) enhancement (4) documentation (1) cla: no (1)