Skip to main content

Root package info.

Project description

Eqxvision

PyPI Github GitHub Release Date GitHub

Eqxvision is a package of popular computer vision model architectures built using Equinox.

Installation

Use the package manager pip to install eqxvision.

pip install eqxvision

requires: python>=3.7

optional: torch, only if pretrained models are required.

Documentation

Available at https://eqxvision.readthedocs.io/en/latest/.

Usage

Picking a model and doing a forward pass is as simple as ...

    import jax
    import jax.random as jr
    import equinox as eqx
    from eqxvision.models import alexnet
    from eqxvision.utils import CLASSIFICATION_URLS
    
    
    @eqx.filter_jit
    def forward(net, images, key):
        keys = jax.random.split(key, images.shape[0])
        output = jax.vmap(net, axis_name=('batch'))(images, key=keys)
        ...
        
    net = alexnet(torch_weights=CLASSIFICATION_URLS['alexnet'])
    
    images = jr.uniform(jr.PRNGKey(0), shape=(1,3,224,224))
    output = forward(net, images, jr.PRNGKey(0))

What's New?

  • Backward incompatible changes to v0.2.0 for loading a pretrained model.
  • FCN added as the first segmentation model.
  • Almost all image classification models are ported from torchvision.
  • New tutorial for generating adversarial examples and others coming soon.

Get Started!

Start with any one of these easy to follow tutorials.

Tips

  • Better to use @equinox.filter_jit instead of @jax.jit.
  • Use jax.{v,p}map with axis_name='batch' when using models that use batch normalisation.
  • Don't forget to switch to inference mode for evaluations. (model = eqx.tree_inference(model))
  • Initialise Optax optimisers as optim.init(eqx.filter(net, eqx.is_array)). (See here.)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Development Process

If you plan to modify the code or documentation, please follow the steps below:

  1. Fork the repository and create your branch from dev.
  2. If you have modified the code (new feature or bug-fix), please add unit tests.
  3. If you have changed APIs, update the documentation. Make sure the documentation builds. mkdocs serve
  4. Ensure the test suite passes. pytest tests -vvv
  5. Make sure your code passes the formatting checks. Automatically checked with a pre-commit hook.

Acknowledgements

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eqxvision-0.2.0.tar.gz (42.1 kB view details)

Uploaded Source

Built Distribution

eqxvision-0.2.0-py3-none-any.whl (61.3 kB view details)

Uploaded Python 3

File details

Details for the file eqxvision-0.2.0.tar.gz.

File metadata

  • Download URL: eqxvision-0.2.0.tar.gz
  • Upload date:
  • Size: 42.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for eqxvision-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1916eae428b098557b5aaf909731ffab828557f6a320c467415470ffaed01ca5
MD5 90ffbc3f0a59184fc5b8d16879db533d
BLAKE2b-256 f36cb1b73f818fca1dcc7b17c5bc35824ffd3d83dcdfcdd36852f16e62e8d3c5

See more details on using hashes here.

File details

Details for the file eqxvision-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: eqxvision-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 61.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for eqxvision-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0b1aede22767d85126a0a1d952494f3cdf8a2437cf2fa99f3d95310d05f776b
MD5 30605cd7f5395c218a88e97269bdb844
BLAKE2b-256 461bf4cd113bf251e517186f60e3ffb6f35195b001fe9b8bc51ee9062602bbd1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page