ConvNeXt V2

ConvNeXt V2 is an image classifier with global response normalization.

Tasks
classification
Install
pip install libreyolo
Support tier
Supported, since v1.6.0. Supporting trainables: kept green in CI, features land opportunistically.
Upstream
ConvNeXt V2 by Meta AI, MIT code; CC-BY-NC-4.0 weights. Paper, source
Licenses
Code MIT, weights MIT code; CC-BY-NC-4.0 weights. Commercial use

Install

bash
pip install "libreyolo"

Predict

Python
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreConvNeXtV2atto-cls.pt", device="cpu")result = model(SAMPLE_IMAGE)print(result.probs)

The eight sizes run classification at 224 pixels. Official pretrained weights are CC-BY-NC-4.0.

Train

Training rebuilds the classification head for an ImageFolder dataset. cls_pw accepts values from 0 to 1 and defaults to 0. class_weights=True selects the alternative sample-normalized weighting; it cannot combine with cls_pw>0. Weighting settings must match when resuming.

Dataset setup describes the required training data.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreConvNeXtV2atto-cls.pt", device="cpu")# "smoke10" auto-downloads; for your own data, pass a folder with train/ and val/ class subfolders.model.train(data="smoke10", epochs=1, device="cpu", workers=0)

Validate

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreConvNeXtV2atto-cls.pt", device="cpu")metrics = model.val(data="smoke10", workers=0)print(metrics)

Use the dataset format for this task. Validation explains the dataset requirements and returned metrics.

Export

TaskONNXTorchScriptExecuTorchTensorRTOpenVINOPaddleMNNRKNNncnnTFLiteCoreMLCore AI
ClassificationClassification to ONNX: supportedClassification to TorchScript: supportedClassification to ExecuTorch: supportedClassification to TensorRT: supportedClassification to OpenVINO: supportedClassification to Paddle: not supportedClassification to MNN: not supportedClassification to RKNN: not supportedClassification to ncnn: supportedClassification to TFLite: not supportedClassification to CoreML: not supportedClassification to Core AI: not supported
Python
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreConvNeXtV2atto-cls.pt", device="cpu")model.export(format="onnx")

Export setup lists format dependencies and loading exported artifacts.

Checkpoints

Every file above exists in the LibreYOLO org today and downloads on first use.

Licensing

Check the license on the Hugging Face repository of the specific weights you download. Every checkpoint in the LibreYOLO org carries one, and they are not always the same across a family. That repository is the authoritative source; the summary below describes what applied when this page was last verified.

This is a description of the licenses involved, not legal advice. If the answer matters commercially, read the licenses yourself and take your own counsel.

Original work
ConvNeXt V2, Meta AI
Upstream license
MIT code; CC-BY-NC-4.0 weights
LibreYOLO code
MIT
Weights
MIT code; CC-BY-NC-4.0 weights, republished at huggingface.co/LibreYOLO
Interpretation
The source code is MIT. Official pretrained weights are CC-BY-NC-4.0 and exclude commercial use.

Citation

@article{Woo2023ConvNeXtV2,
  title={ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders},
  author={Sanghyun Woo, Shoubhik Debnath, Ronghang Hu, Xinlei Chen, Zhuang Liu, In So Kweon and Saining Xie},
  year={2023},
  journal={arXiv preprint arXiv:2301.00808},
}

Copied from the authors' citation block at raw.githubusercontent.com/facebookresearch/ConvNeXt-V2/main/README.md.

Verified against LibreYOLO v1.6.0. Support tables, checkpoints and benchmark numbers on this page are generated from the released library and the published weights, not written by hand.