Skip to content

[DRAFT] Mobile ViT #6965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
- black == 22.3.0
- usort == 1.0.2

- repo: https://gitlab.com/pycqa/flake8
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
Expand Down
27 changes: 27 additions & 0 deletions docs/source/models/mobilevit.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
..
_TODO: Update the documentation with the correct links...


MobileViT
===========

.. currentmodule:: torchvision.models

The MobileViT model is based on the `"MobileViT: Light-Weight, General-Purpose, and Mobile-Friendly Vision Transfomer" <https://arxiv.org/abs/2110.02178>`__ paper.


Model builders
--------------

The following model builders can be used to instantiate a MobileViT model, with or
without pre-trained weights. All the model builders internally rely on the
``torchvision.models.mobilevit.MobileViT`` base class. Please refer to the `source
code
<https://github.com/pytorch/vision/blob/main/torchvision/models/mobilevit.py>`_ for
more details about this class.

.. autosummary::
:toctree: generated/
:template: function.rst

mobilevit
1 change: 1 addition & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python setup.py develop && torchrun --nproc_per_node=8 vision-1/references/classification/train.py --model mobile_vit_xxs
1 change: 1 addition & 0 deletions torchvision/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
from .vgg import *
from .vision_transformer import *
from .swin_transformer import *
from .mobilevit import *
from . import detection, optical_flow, quantization, segmentation, video
from ._api import get_model, get_model_weights, get_weight, list_models
Loading