https://github.com/google-research/scenic

Scenic: A Jax Library for Computer Vision Research and Beyond

https://github.com/google-research/scenic

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
    Links to: arxiv.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.9%) to scientific vocabulary

Keywords

attention computer-vision deep-learning jax research transformers vision-transformer

Keywords from Contributors

distributed deep-neural-networks reinforcement-learning tpu transformer distributed-training weather deep-reinforcement-learning neuralgcm advertising
Last synced: 4 months ago · JSON representation

Repository

Scenic: A Jax Library for Computer Vision Research and Beyond

Basic Info
  • Host: GitHub
  • Owner: google-research
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 65.2 MB
Statistics
  • Stars: 3,678
  • Watchers: 35
  • Forks: 462
  • Open Issues: 289
  • Releases: 0
Topics
attention computer-vision deep-learning jax research transformers vision-transformer
Created over 4 years ago · Last pushed 5 months ago
Metadata Files
Readme Contributing License

README.md

Scenic

scenic logo

Scenic is a codebase with a focus on research around attention-based models for computer vision. Scenic has been successfully used to develop classification, segmentation, and detection models for multiple modalities including images, video, audio, and multimodal combinations of them.

More precisely, Scenic is a (i) set of shared light-weight libraries solving tasks commonly encountered tasks when training large-scale (i.e. multi-device, multi-host) vision models; and (ii) several projects containing fully fleshed out problem-specific training and evaluation loops using these libraries.

Scenic is developed in JAX and uses Flax.

Contents

What we offer

Among others Scenic provides

  • Boilerplate code for launching experiments, summary writing, logging, profiling, etc;
  • Optimized training and evaluation loops, losses, metrics, bi-partite matchers, etc;
  • Input-pipelines for popular vision datasets;
  • Baseline models, including strong non-attentional baselines.

SOTA models and baselines in Scenic

There are some SOTA models and baselines in Scenic which were either developed using Scenic, or have been reimplemented in Scenic:

Projects that were developed in Scenic or used it for their experiments:

More information can be found in projects.

Baselines that were reproduced in Scenic:

More information can be found in baseline models.

Philosophy

Scenic aims to facilitate rapid prototyping of large-scale vision models. To keep the code simple to understand and extend we prefer forking and copy-pasting over adding complexity or increasing abstraction. Only when functionality proves to be widely useful across many models and tasks it may be upstreamed to Scenic's shared libraries.

Getting started

  • See projects/baselines/README.md for a walk-through baseline models and instructions on how to run the code.
  • If you would like to contribute to Scenic, please check out the Philisophy, Code structure and Contributing sections. Should your contribution be a part of the shared libraries, please send us a pull request!

Quickstart

You will need Python 3.9 or later. Download the code from GitHub

shell $ git clone https://github.com/google-research/scenic.git $ cd scenic $ pip install .

and run training for ViT on ImageNet:

shell $ python scenic/main.py -- \ --config=scenic/projects/baselines/configs/imagenet/imagenet_vit_config.py \ --workdir=./

Note that for specific projects and baselines, you might need to install extra packages that are mentioned in their README.md or requirements.txt files.

Here is also a minimal colab to train a simple feed-forward model using Scenic.

Scenic component design

Scenic is designed to propose different levels of abstraction, to support hosting projects that only require changing hyper-parameters by defining config files, to those that need customization on the input pipeline, model architecture, losses and metrics, and the training loop. To make this happen, the code in Scenic is organized as either project-level code, which refers to customized code for specific projects or baselines or library-level code, which refers to common functionalities and general patterns that are adapted by the majority of projects. The project-level code lives in the projects directory.

scenic design

Library-level code

The goal is to keep the library-level code minimal and well-tested and to avoid introducing extra abstractions to support minor use-cases. Shared libraries provided by Scenic are split into:

  • dataset_lib: Implements IO pipelines for loading and pre-processing data for common Computer Vision tasks and benchmarks (see "Tasks and Datasets" section). All pipelines are designed to be scalable and support multi-host and multi-device setups, taking care dividing data among multiple hosts, incomplete batches, caching, pre-fetching, etc.
  • model_lib : Provides
    • several abstract model interfaces (e.g. ClassificationModel or SegmentationModel in model_lib.base_models) with task-specific losses and metrics;
    • neural network layers in model_lib.layers, focusing on efficient implementation of attention and transformer layers;
    • accelerator-friendly implementations of bipartite matching algorithms in model_lib.matchers.
  • train_lib: Provides tools for constructing training loops and implements several optimized trainers (classification trainer and segmentation trainer) that can be forked for customization.
  • common_lib: General utilities, like logging and debugging modules, functionalities for processing raw data, etc.

Project-level code

Scenic supports the development of customized solutions for customized tasks and data via the concept of "project". There is no one-fits-all recipe for how much code should be re-used by a project. Projects can consist of only configs and use the common models, trainers, task/data that live in library-level code, or they can simply fork any of the mentioned functionalities and redefine, layers, losses, metrics, logging methods, tasks, architectures, as well as training and evaluation loops. The modularity of library-level code makes it flexible for projects to fall placed on any spot in the "run-as-is" to "fully customized" spectrum.

Common baselines such as a ResNet and Vision Transformer (ViT) are implemented in the projects/baselines project. Forking models in this directory is a good starting point for new projects.

Citing Scenic

If you use Scenic, you can cite our white paper. Here is an example BibTeX entry:

bibtex @InProceedings{dehghani2021scenic, author = {Dehghani, Mostafa and Gritsenko, Alexey and Arnab, Anurag and Minderer, Matthias and Tay, Yi}, title = {Scenic: A JAX Library for Computer Vision Research and Beyond}, booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)}, year = {2022}, pages = {21393-21398} }

Disclaimer: This is not an official Google product.

Owner

  • Name: Google Research
  • Login: google-research
  • Kind: organization
  • Location: Earth

GitHub Events

Total
  • Issues event: 15
  • Watch event: 367
  • Delete event: 26
  • Issue comment event: 46
  • Push event: 104
  • Pull request event: 58
  • Fork event: 42
  • Create event: 28
Last Year
  • Issues event: 15
  • Watch event: 364
  • Delete event: 26
  • Issue comment event: 46
  • Push event: 104
  • Pull request event: 58
  • Fork event: 42
  • Create event: 28

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 719
  • Total Committers: 95
  • Avg Commits per committer: 7.568
  • Development Distribution Score (DDS): 0.773
Past Year
  • Commits: 39
  • Committers: 22
  • Avg Commits per committer: 1.773
  • Development Distribution Score (DDS): 0.718
Top Committers
Name Email Commits
Mostafa Dehghani d****i@g****m 163
Scenic Authors n****y@g****m 122
Anurag Arnab a****b@g****m 65
Matthias Minderer m****m@g****m 59
Peter Hawkins p****s@g****m 31
Zahra Shamsi s****z@g****m 19
Alexey Gritsenko a****o@g****m 19
Thomas Unterthiner u****r@g****m 16
Jake VanderPlas v****s@g****m 16
Utku Evci e****u@g****m 10
Marcus Chiam m****m@g****m 8
Michael Ryoo m****o@g****m 8
Santiago Castro s****o@g****m 7
Yilei Yang y****g@g****m 6
Rebecca Chen r****n@g****m 6
Mathilde Caron m****n@g****m 6
Manoj Kumar m****r@g****m 6
Krzysztof Choromanski k****o@g****m 6
Xingyi Zhou z****y@g****m 5
Gang Li l****d@g****m 5
Anthony Sherbondy t****y@g****m 5
Aaron Sarna s****a@g****m 5
Ahmet Iscen i****n@g****m 4
Andreas Bär a****r@g****m 4
Arsha Nagrani a****i@g****m 4
Mario Lucic l****c@g****m 4
Maxim Neumann m****n@g****m 4
Ryan Carelli r****i@g****m 4
Shuang Liu s****l@g****m 4
Paul Hongsuck Seo p****o@g****m 3
and 65 more...
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 5 months ago

All Time
  • Total issues: 166
  • Total pull requests: 330
  • Average time to close issues: 3 months
  • Average time to close pull requests: 18 days
  • Total issue authors: 148
  • Total pull request authors: 12
  • Average comments per issue: 2.09
  • Average comments per pull request: 0.29
  • Merged pull requests: 100
  • Bot issues: 1
  • Bot pull requests: 315
Past Year
  • Issues: 16
  • Pull requests: 73
  • Average time to close issues: N/A
  • Average time to close pull requests: 4 days
  • Issue authors: 16
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.21
  • Merged pull requests: 38
  • Bot issues: 0
  • Bot pull requests: 73
Top Authors
Issue Authors
  • ronhag (5)
  • MaxTeselkin (3)
  • dmrangak (3)
  • ChukwumaChukwuma (2)
  • kent252 (2)
  • sycamoreoak (2)
  • DishantMewada (2)
  • rohit901 (2)
  • parhameftekhar (2)
  • Aki1991 (2)
  • FrancescoSaverioZuppichini (2)
  • KJ-rc (2)
  • Aasthaengg (2)
  • shaniaos (1)
  • dcompgriff (1)
Pull Request Authors
  • copybara-service[bot] (309)
  • dependabot[bot] (6)
  • Mas-Ayb (2)
  • IamJeffG (2)
  • zch42 (2)
  • navdeepkk-polymagelabs (2)
  • TheMattBin (2)
  • samarthtehri (1)
  • satojkovic (1)
  • anonymousdouble (1)
  • eltociear (1)
  • MasterSkepticista (1)
Top Labels
Issue Labels
projects (1)
Pull Request Labels
dependencies (6)

Dependencies

scenic/projects/baselines/bert/requirements.txt pypi
  • sklearn *
scenic/projects/baselines/clip/requirements.txt pypi
  • torch >=1.10.2
  • tqdm *
scenic/projects/baselines/deformable_detr/requirements.txt pypi
  • absl-py *
  • clu *
  • flax ==0.5.3
  • ipdb *
  • jax ==0.3.17
  • jaxlib ==0.3.15
  • numpy *
  • ott-jax *
  • sklearn *
  • tensorflow *
  • tensorflow-datasets *
scenic/projects/baselines/detr/requirements.txt pypi
  • ott-jax >=0.2.0
  • pycocotools *
scenic/projects/mbt/requirements.txt pypi
  • lingvo ==0.11.0
scenic/projects/mtv/requirements.txt pypi
  • seaborn >=0.11.2
scenic/projects/ncr/requirements.txt pypi
  • Pillow ==9.1.1
  • absl ==0.0
  • chex ==0.1.3
  • optax ==0.1.2
  • tensorflow_datasets ==4.6.0
scenic/projects/owl_vit/requirements.txt pypi
  • lvis *
  • ott-jax *
  • torch >=1.10.2
  • tqdm *
scenic/projects/polyvit/requirements.txt pypi
  • seaborn >=0.11.2
scenic/projects/vivit/requirements.txt pypi
  • seaborn >=0.11.2