--- id: fvcore version: "0.1.5.post20221221" license: Apache 2.0 license_treatment: permissive maintenance: active --- # fvcore — Collection of common code shared among different research projects in FAIR computer vision team License: permissive · Maintenance: active · Downloads: 2.1M/mo ## 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 above — 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 pip install fvcore uv add fvcore poetry add fvcore ## Installing 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_current - Install friction: high - Maintenance: active - Downloads: 2.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pytorch computer vision utilities, flop counting neural networks, parameter counting pytorch, batch norm statistics, hyperparameter scheduler pytorch, pytorch, computer-vision, profiling [View on SkillFed](https://skillfed.io/packages/fvcore) · [View on PyPI](https://pypi.org/project/fvcore/)