Skip to main content

Implementations of Recent Papers in Computer Vision

Project description

ComVEX: Computer Vision EXpo

PyPI version Package Status Models' Testing

Hi there! This is a reimplementation library for computer vision models by PyTorch and Einops. Our mission is to bridge papers and codes with consistent and clear implementations.

What are the pros?

  1. Consistent Structure
    Every models share similar building objects:

    • xxxBase: A model's base. For checking common input arguments and storing important variables. Sometimes it can also provide specified weight initialization methods or necessary tensor operations, like patching and flattening images in ViT.
    • xxxBackbone: A model's backbone architecture. It includes every needed components to build the model except the classifier.
    • xxxWithLinearClassifier: xxxBackbone plus a projection head as its classifier. Only accept xxxConfig as its argument. Similar to Huggingface. Might provide some variants for differenet objective in the future.
    • xxxConfig: A configuration for all possible coefficients. It also provides model specializations mentioned in the papers.
  2. Consistent Namings for papers and across papers
    To make researchers or developers understand implementations as soon as possible, we tightly follow the names of model components from the official papers and be consistent on common namings across papers.

  3. Clear Tensor Operations
    We use Einops for almost all tensor operations to unveil the dimensions of tensors, which are usually hidden in the code, and make our implementations explain by themselves.

  4. Clear Arguments
    To expose all possible arguments to users but still remain convenience, we categorize building objects into a hierarchical order with 3 levels listed from bottom to top as below:

    • Basic : The paper-proposed and essential objects that mostly inherit directly from nn.Module or other Basic objects, like ViTBase, MultiheadAttention, SpatialGatingUnit, etc.
    • Wrapper: Intermediate objects or wrappers that organize Basic ones, like TransformerEncoderLayer, PerceiverBlock, MLPMixerLayer, xxxWithLinearClassifier, etc.
    • Model: xxxBackbone and xxxConfig.

    Basic and Model objects are the ones crucial for paper-to-code mappings and model usages, so we require their arguments to be fully explicit to users (list all arguments in __init__ methods). And for the sake of convenience, Wrapper objects can use args or **kwargs to pass down necessary arguments. The overall model structures in term of the number of required arguments will look like a hourglass.

  5. Semantic Naming
    Excluding some common names like x for the input tensors, ff_dropout for the dropout rate of feed forward networks, and act_func_name for a string of activation function's name supported by PyTorch, all variables, helper functions, and objects should be named meaningfully.

  6. Detailed Model Information
    Every models has its own README.md that provides usages, one-by-one argument explanations, and all usable objects and specializations. The official implementations are provided as well if any mentioned in the official paper.

How to install?

pip3 install comvex

How to use?

Please check out the Usage section detailed in models' own README.md.

How to contribute?

Please check out the CONTRIBUTING.md for details.

Notes

  • Continuously implementing models, please check them out under the comvex folder for more details and examples folder for some demos.
  • Pull requests are welcome!
  • From this issue, inheritance doesn't support in torchscript. Therefore, most of our implementations aren't scriptable. But trace seems that doesn't exist this kind of issue and we will use trace as our default and gradually update our code to make ComVEX a trace-supported library.

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

comvex-0.4.0.tar.gz (71.2 kB view details)

Uploaded Source

Built Distribution

comvex-0.4.0-py3-none-any.whl (99.5 kB view details)

Uploaded Python 3

File details

Details for the file comvex-0.4.0.tar.gz.

File metadata

  • Download URL: comvex-0.4.0.tar.gz
  • Upload date:
  • Size: 71.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for comvex-0.4.0.tar.gz
Algorithm Hash digest
SHA256 9740e8ea89be35b331b9b73b2e8578456438bb50a78e2f11f55d54aef2a6593c
MD5 30704dc9416dc173144de6709ef60078
BLAKE2b-256 d9bc16fad512507790e39e1dc953bdabfc1ad87db3b45345275af7b0b44392af

See more details on using hashes here.

File details

Details for the file comvex-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: comvex-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 99.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for comvex-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f996a46b215036716490dcf50068a554f5cd7c6abd41a55feabdb68ff634888
MD5 bc868a1bab8db3f71754a3307ec97ada
BLAKE2b-256 0b3d7cdd490140ccb473856c513fd2a8eb4309be9d35a46d8c1fb3afd8f9880d

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