MCPcopy Index your code
hub / github.com/apple/ml-cvnets

github.com/apple/ml-cvnets @cvnets-v0.4 sqlite

repository ↗ · DeepWiki ↗ · release cvnets-v0.4 ↗
1,989 symbols 7,716 edges 392 files 785 documented · 39%
README

CVNets: A library for training computer vision networks

CVNets is a computer vision toolkit that allows researchers and engineers to train standard and novel mobile- and non-mobile computer vision models for variety of tasks, including object classification, object detection, semantic segmentation, and foundation models (e.g., CLIP).

Table of contents

What's new?

Installation

We recommend to use Python 3.10+ and PyTorch (version >= v1.12.0)

Instructions below use Conda, if you don't have Conda installed, you can check out How to Install Conda.

# Clone the repo
git clone git@github.com:apple/ml-cvnets.git
cd ml-cvnets

# Create a virtual env. We use Conda
conda create -n cvnets python=3.10.8
conda activate cvnets

# install requirements and CVNets package
pip install -r requirements.txt -c constraints.txt
pip install --editable .

Getting started

  • General instructions for working with CVNets are given here.
  • Examples for training and evaluating models are provided here and here.
  • Examples for converting a PyTorch model to CoreML are provided here.

Supported models and Tasks

To see a list of available models and benchmarks, please refer to Model Zoo and examples folder.

ImageNet classification models

Multimodal Classification

Object detection

Semantic segmentation

Foundation models

Automatic Data Augmentation

Distillation

  • Soft distillation
  • Hard distillation

Maintainers

This code is developed by Sachin, and is now maintained by Sachin, Maxwell Horton, Mohammad Sekhavat, and Yanzi Jin.

Previous Maintainers

Research effort at Apple using CVNets

Below is the list of publications from Apple that uses CVNets:

Contributing to CVNets

We welcome PRs from the community! You can find information about contributing to CVNets in our contributing document.

Please remember to follow our Code of Conduct.

License

For license details, see LICENSE.

Citation

If you find our work useful, please cite the following paper:

@inproceedings{mehta2022mobilevit,
     title={MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer},
     author={Sachin Mehta and Mohammad Rastegari},
     booktitle={International Conference on Learning Representations},
     year={2022}
}

@inproceedings{mehta2022cvnets, 
     author = {Mehta, Sachin and Abdolhosseini, Farzad and Rastegari, Mohammad}, 
     title = {CVNets: High Performance Library for Computer Vision}, 
     year = {2022}, 
     booktitle = {Proceedings of the 30th ACM International Conference on Multimedia}, 
     series = {MM '22} 
}

Core symbols most depended-on inside this repo

keys
called by 78
utils/registry.py
items
called by 77
utils/registry.py
get_config
called by 37
tests/configs.py
eval
called by 35
loss_fn/composite_loss.py
is_master
called by 34
utils/ddp_utils.py
update
called by 32
metrics/stats.py
info
called by 21
cvnets/models/base_model.py
make_divisible
called by 21
utils/math_utils.py

Shape

Method 1,171
Function 485
Class 317
Route 16

Languages

Python100%

Modules by API surface

data/transforms/image_pil.py115 symbols
data/transforms/video.py57 symbols
utils/third_party/ddp_functional_utils.py40 symbols
data/transforms/audio.py36 symbols
cvnets/layers/conv_layer.py28 symbols
data/datasets/dataset_base.py26 symbols
data/transforms/image_bytes.py24 symbols
data/sampler/base_sampler.py23 symbols
cvnets/modules/fastvit.py22 symbols
metrics/metric_base.py21 symbols
cvnets/neural_augmentor/utils/neural_aug_utils.py21 symbols
cvnets/modules/mobilevit_block.py21 symbols

Dependencies from manifests, versioned

black22.10.0 · 1×
isort5.12.0 · 1×

For agents

$ claude mcp add ml-cvnets \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact