查看 Markdown

ConvNeXt V2

ConvNeXt V2 is an image classifier with global response normalization.

任务
classification
安装
pip install libreyolo
支持层级
已支持,自 v1.6.0 起。起支撑作用的可训练家族:在 CI 里保持绿色,功能视情况落地。
上游
ConvNeXt V2,由 Meta AI 发布,采用 MIT code; CC-BY-NC-4.0 weights 许可。论文、源码
许可
代码采用 MIT,权重采用 MIT code; CC-BY-NC-4.0 weights。商用

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

任务ONNXTorchScriptExecuTorchTensorRTOpenVINOPaddleMNNRKNNncnnTFLiteCoreMLCore AI
ClassificationClassification to ONNX:支持Classification to TorchScript:支持Classification to ExecuTorch:支持Classification to TensorRT:支持Classification to OpenVINO:支持Classification to Paddle:不支持Classification to MNN:不支持Classification to RKNN:不支持Classification to ncnn:支持Classification to TFLite:不支持Classification to CoreML:不支持Classification to Core AI:不支持
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

上面的每个文件目前都在 LibreYOLO 组织中,并会在首次使用时下载。

Licensing

请检查你所下载的具体权重在 Hugging Face 仓库中的许可。LibreYOLO 组织里的每个检查点都附有许可,同一家族内也不一定相同。该仓库是权威来源;以下摘要说明本页上次验证时适用的情况。

这里只说明涉及的许可证,不构成法律意见。如果答案对商用很重要,请自行阅读许可证并咨询法律顾问。

原始工作
ConvNeXt V2, Meta AI
上游许可
MIT code; CC-BY-NC-4.0 weights
LibreYOLO 代码
MIT
权重
采用 MIT code; CC-BY-NC-4.0 weights 许可,重新发布在 huggingface.co/LibreYOLO
解读
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},
}

复制自作者在 raw.githubusercontent.com/facebookresearch/ConvNeXt-V2/main/README.md 上提供的引用块。

已针对 LibreYOLO v1.6.0 验证。本页的支持表、检查点和基准测试数据由已发布的库和权重生成,并非手工编写。