YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Image Quality Classification - EfficientNet-B0

基于 EfficientNet-B0 的图片内容分级模型,支持 L1-L4 四级分类。

分类标准

等级 说明 示例
L1 轻度性感内容 正常身材+性感内衣/衣物遮挡下体,姿势正常无性暗示
L2 中度性感内容 夸张身材+衣着性感/较少,姿势有较强性暗示
L3 重度性感内容 裸露(半裸/全裸),私密部位暴露
L4 色情内容 明确性行为/性交内容

详细分级标准见 数据准备文档

模型性能

基准测试

项目
模型 0.onnx
架构 EfficientNet-B0
大小 14.2 MB
精度 FP32
设备 CPU

推理速度

指标
Mean 82.04 ms
Median 96.23 ms
P99 188.17 ms
Min 11.72 ms
Max 209.72 ms
FPS 12

分类精度

等级 准确率
Overall 82.50% (n=1400)
L1 87.47%
L2 73.31%
L3 84.87%
L4 82.93%

使用方式

ONNX Runtime 推理

import onnxruntime as ort
import numpy as np
from PIL import Image
from torchvision import transforms

# 加载模型
session = ort.InferenceSession("0.onnx")
input_name = session.get_inputs()[0].name

# 图像预处理
transform = transforms.Compose([
    transforms.Resize(256),
    transforms.CenterCrop(224),
    transforms.ToTensor(),
    transforms.Normalize(mean=[0.485, 0.456, 0.406],
                         std=[0.229, 0.224, 0.225]),
])

img = Image.open("image.jpg").convert("RGB")
input_tensor = transform(img).unsqueeze(0).numpy()

# 推理
outputs = session.run(None, {input_name: input_tensor})[0]
pred_id = np.argmax(outputs, axis=1)[0]
class_names = ["L1", "L2", "L3", "L4"]
print(f"预测等级: {class_names[pred_id]}")

命令行推理

python inference.py --model 0.onnx --image /path/to/image.jpg

权重文件

文件名 大小 说明
0.onnx 14.2 MB FP32 ONNX 模型(最佳权重)

训练

训练代码位于 image_L_class_train,基于 EfficientNet-B0 + timm 训练框架。

训练数据

  • 来源:Civitai 图片分级标注
  • 分级:L1-L4 四类
  • 数据量:约 6000 张

部署建议

  • CPU 推理: ONNX Runtime 直接部署,单张约 80ms
  • GPU 推理: 可用 TensorRT 优化,速度提升 5-10 倍
  • INT8 量化: 可进一步压缩体积至 ~5MB,速度提升 2-3 倍
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support