| Crates.io | openlb |
| lib.rs | openlb |
| version | 0.1.1 |
| created_at | 2025-11-04 17:20:16.803876+00 |
| updated_at | 2025-11-04 18:09:42.558203+00 |
| description | A high-speed Sexual Image classifier and filtering library |
| homepage | |
| repository | https://github.com/PonderForge/OpenLB |
| max_upload_size | |
| id | 1916633 |
| size | 789,115 |
OpenLB is a fast, minimal, and practical library for detecting and filtering sexual / NSFW content in images and text. It is written in Rust and designed for easy integration into existing Rust projects or services.
Features
Getting started
/model directory next to the compiled binary.use openlb::img_filter::{ImgCleaner, ImgCleanLevel};
let cleaner = ImgCleaner::builder().commit();
let img = image::open("test.jpg").unwrap();
let result = cleaner.clean_image(img, ImgCleanLevel::Overall);
match result {
None => println!("No NSFW content detected"),
Some(filtered) => filtered.save("out.jpg").unwrap(),
}
Reference API: use openlb::img_filter::ImgCleaner for image workflows.
use openlb::text_filter::TxtCleaner;
let txt = std::fs::read_to_string("test.txt").unwrap();
let cleaner = TxtCleaner::builder().commit();
let cleaned = cleaner.clean_text(txt);
std::fs::write("out.txt", cleaned).unwrap();
See openlb::text_filter::TxtCleaner for textual workflows.
Why choose OpenLB
Contributing
AI models
Credits
pykeio/ort: Used for all ONNX inferencing, and acceleration.
ultralytics/ultralytics: Used the YOLOV11 architecture for human detection for per-human NSFW filtering.
Tianfang-Zhang/CAS-ViT: Used their archtecture as the backbone for our image classification system.
MobileBERT: Used their archtecture as the backbone for our textual classification system.
Jesus Christ: My savior, my redeemer, my rock, my king, my commander, and literally the sole reason I exist. Wrote the book that warned us about lust and still loves us when we ignore it. All Hail King Jesus!
This was created by PonderForge, if you use this code, give credit where credit is due. Pslam 111:2 "Great are the works of the LORD; they are pondered by all who delight in them."
(This README was initally written by AI as a base, however none of the code is AI generated.)