ClassyVision
An end-to-end PyTorch framework for image and video classification
Install / Use
/learn @facebookresearch/ClassyVisionREADME
Classy Vision is no longer actively maintained.
The latest stable version is 0.7.0 and is available on pip, and has been tested to work with Pytorch 2.0.
What's New:
- March 2021: Added RegNetZ models
- November 2020: Vision Transformers now available, with training recipes!
New Features
- Release Vision Transformers model implementation, with recipes(#646)
- Implemented gradient clipping (#643)
- Implemented gradient accumulation (#644)
- Added support for AdamW (#636)
- Added Precise batch norm hook (#592)
- Added support for adaptive pooling in
fully_convolutional_linear_head(#602) - Added support for sync batch norm group size (#534)
- Added a CSV Hook to manually inspect model predictions
- Added a ClassyModel tutorial (#485)
- Migrated to Hydra 1.0 (#536)
- Migrated off of tensorboardX (#488)
Breaking Changes
ClassyOptimizerAPI improvements- added
OptionsViewto retrieve options from the optimizerparam_group
- added
- Removed
ClassyModel.evaluation_mode(#521) - Removed
ImageNetDataset, now a subset ofImagePathDataset(#494) - Renamed
is_mastertois_primaryindistributed_util(#576)
New Features
- Release EfficientNet model implementation (#475)
- Add support to convert any
PyTorchmodel to aClassyModelwith the ability to attach heads to it (#461) - Squeeze and Excitation support for
ResNe(X)tandDenseNetmodels (#426, #427) - Made
ClassyHooks registrable (#401) and configurable (#402) - Migrated to
TorchElastic v0.2.0(#464) - Add
SyncBatchNormsupport (#423) - Implement
mixuptrain augmentation (#469) - Support
LARCfor SGD optimizer (#408) - Added convenience wrappers for
Iterabledatasets (#455) Tensorboardimprovements- Invalid (
NaN/Inf) loss detection - Revamped logging (#478)
- Add
bn_weight_decayconfiguration option forResNe(X)tmodels - Support specifying
update_intervalto Parameter Schedulers (#418)
Breaking changes
ClassificationTaskAPI improvement andtrain_step,eval_stepsimplification- Rename
lrtovaluein parameter schedulers (#417)
Release notes
checkpoint_folderrenamed tocheckpoint_load_path(#379)- head support on
DenseNet(#383) - Cleaner abstraction in
ClassyTask/ClassyTrainer:eval_step,on_start,on_end, … - Speed metrics in TB (#385)
test_phase_periodinClassificationTask(#395)- support for losses with trainable parameters (#394)
- Added presets for some typical
ResNe(X)tconfigurations: #405)
About
Classy Vision is a new end-to-end, PyTorch-based framework for large-scale training of state-of-the-art image and video classification models. Previous computer vision (CV) libraries have been focused on providing components for users to build their own frameworks for their research. While this approach offers flexibility for researchers, in production settings it leads to duplicative efforts, and requires users to migrate research between frameworks and to relearn the minutiae of efficient distributed training and data loading. Our PyTorch-based CV framework offers a better solution for training at scale and for deploying to production. It offers several notable advantages:
- Ease of use. The library features a modular, flexible design that allows anyone to train machine learning models on top of PyTorch using very simple abstractions. The system also has out-of-the-box integration with Amazon Web Services (AWS), facilitating research at scale and making it simple to move between research and production.
- High performance. Researchers can use the framework to train Resnet50 on ImageNet in as little as 15 minutes, for example.
- Demonstrated success in training at scale. We’ve used it to replicate the state-of-the-art results from the paper Exploring the Limits of Weakly Supervised Pretraining.
- Integration with PyTorch Hub. AI researchers and engineers can download and fine-tune the best publically available ImageNet models with just a few lines of code.
- Elastic training. We have also added experimental integration with PyTorch Elastic, which allows distributed training jobs to adjust as available resources in the cluster changes. It also makes distributed training robust to transient hardware failures.
Classy Vision is beta software. The project is under active development and our APIs are subject to change in future releases.
Installation
Installation Requirements
Make sure you have an up-to-date installation of PyTorch (1.6), Python (3.6) and torchvision (0.7). If you want to use GPUs, then a CUDA installation (10.1) is also required.
Installing the latest stable release
To install Classy Vision via pip:
pip install classy_vision
To install Classy Vision via conda (only works on linux):
conda install -c conda-forge classy_vision
Manual install of latest commit on main
Alternatively you can do a manual install.
git clone https://github.com/facebookresearch/ClassyVision.git
cd ClassyVision
pip install .
Getting started
Classy Vision aims to support a variety of projects to be built and open sourced on top of the core library. We provide utilities for setting up a project in a standard format with some simple generated examples to get started with. To start a new project:
classy-project my-project
cd my-project
We even include a simple, synthetic, training example to show how to use Classy Vision:
./classy_train.py --config configs/template_config.json
Voila! A few seconds later your first training run using our classification task should be done. Check out the results in the output folder:
ls output_<timestamp>/checkpoints/
checkpoint.torch model_phase-0_end.torch model_phase-1_end.torch model_phase-2_end.torch model_phase-3_end.torch
checkpoint.torch is the latest model (in this case, same as model_phase-3_end.torch), a checkpoint is saved at the end of each phase.
For more details / tutorials see the documentation section below.
Documentation
Please see our tutorials to learn how to get started on Classy Vision and cust
Related Skills
qqbot-channel
346.4kQQ 频道管理技能。查询频道列表、子频道、成员、发帖、公告、日程等操作。使用 qqbot_channel_api 工具代理 QQ 开放平台 HTTP 接口,自动处理 Token 鉴权。当用户需要查看频道、管理子频道、查询成员、发布帖子/公告/日程时使用。
docs-writer
100.1k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
346.4kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
Design
Campus Second-Hand Trading Platform \- General Design Document (v5.0 \- React Architecture \- Complete Final Version)1\. System Overall Design 1.1. Project Overview This project aims t
