fvcore
Collection of common code shared among different research projects in FAIR computer vision team
What it is and what it does
fvcore is a lightweight library maintained by Facebook AI Research (FAIR) that centralizes common computer vision utilities used across their research projects. It provides PyTorch-native components: standard neural network layers and loss functions, a hierarchical FLOP counter for profiling model efficiency, recursive parameter counting for model analysis, batch normalization statistics recomputation, and a stateless hyperparameter scheduler. All code is type-annotated and tested.
The library is designed for researchers and engineers working with PyTorch who need standard computer vision utilities without heavyweight dependencies. It has no runtime dependencies listed in the package metadata, though PyTorch itself is a hard requirement. The package is actively maintained at the repository level but has not received a PyPI release since December 2022, which may affect compatibility with very recent PyTorch versions.
Use it for:
- Profile model computational cost (FLOPs) during development to optimize architectures before training.
- Analyze parameter counts and memory footprint of neural networks for deployment planning.
- Recompute batch normalization statistics on a new dataset without retraining the full model.
- Schedule learning rates and other hyperparameters in a scale-invariant, reproducible way across experiments.
- Access common PyTorch layers and loss functions shared across FAIR research codebases.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
fvcore provides shared computer vision utilities for PyTorch, including neural network layers, loss functions, FLOP counting, parameter analysis, and hyperparameter scheduling used across FAIR's research frameworks.
Yes, if you use PyTorch for computer vision research and need standard profiling or scheduling utilities. The library is actively maintained at the repository level, permissively licensed, and widely used in FAIR projects. However, note that the last PyPI release was December 2022—verify compatibility with your PyTorch version before installing, and consider installing from GitHub if you need the latest code.
Install
fvcore on PyPI
pip
pip install fvcoreuv
uv add fvcorepoetry
poetry add fvcoreInstalling fvcore
Before you install
High install friction: the package requires PyTorch as a system dependency and has not been updated on PyPI since December 2022, though the repository remains active with recent commits. Installation may require resolving PyTorch separately depending on your environment.
License in practice
Released under Apache 2.0 (permissive), allowing commercial and private use with minimal restrictions, though you must include a copy of the license and note any modifications.
Quickstart
pip install fvcore
from fvcore.nn import FlopCountAnalyzer
flops = FlopCountAnalyzer(model, input_shape).total()
Requires PyTorch to be installed separately; Python >= 3.6 required.
Verify before relying
- Whether PyTorch version constraints exist beyond the requirement for pytorch itself
- Current status of nightly PyPI updates mentioned in the install instructions
- Compatibility with modern PyTorch versions given the December 2022 release date
- Whether FlopCountAnalyzer is the primary entry point or if other APIs are more commonly used
Package facts
| License | Apache 2.0 (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,332 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,121,804/month — #3,277 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fvcore-0.1.5.post20221221.tar.gz
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
torchvisionTorchvision provides pre-built datasets, model…
permissive · top 1,000 on PyPI
pytorchcvProvides a collection of pretrained computer…
unclear · top 15,000 on PyPI
pytorch_optimizerProvides a collection of modern optimizers,…
permissive · top 15,000 on PyPI
pipablepytorch3dPyTorch3D provides reusable components for 3D…
permissive · top 5,000 on PyPI
icevisionIceVision provides a unified framework for…
permissive · top 15,000 on PyPI
torchprofileCounts multiply-accumulate operations (MACs) in…
permissive · top 15,000 on PyPI
inference-modelsLoads and runs computer vision models from…
unclear · top 15,000 on PyPI
pytorch-forecastingPyTorch Forecasting provides neural network…
permissive · top 15,000 on PyPI
facexlibFacexlib provides a collection of PyTorch-based…
permissive · top 5,000 on PyPI
basicsrBasicSR is a PyTorch-based toolbox for image…
permissive · top 15,000 on PyPI