Instructions to use enaser/blurguard-models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use enaser/blurguard-models with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
BlurGuard models
These are the on-device models used by BlurGuard, an Android app that covers nudity and immodest content on screen as it appears. The app downloads a file only when it is needed and checks it against the size and SHA-256 listed below. It then runs the model on the phone's GPU with LiteRT (TensorFlow Lite), falling back to the CPU. Screen images never leave the phone.
Every file is a format conversion of a published model. Nothing was retrained or fine-tuned. Each file keeps the license of the model it came from (see LICENSE.md).
Files
| File | Made from | License | Size |
|---|---|---|---|
nudenet_320n_640_fp16.tflite |
NudeNet 320n (YOLOv8n), SimonJoz/nudenet 320n.pt |
AGPL-3.0 | 6.2 MB |
nudenet_640m_640_fp16.tflite |
NudeNet 640m (YOLOv8m), SimonJoz/nudenet 640m.pt |
AGPL-3.0 | 51.9 MB |
anime_censor_n_640_fp16.tflite |
deepghs/anime_censor_detection censor_detect_v1.0_n/model.pt |
MIT | 6.1 MB |
anime_censor_s_640_fp16.tflite |
deepghs/anime_censor_detection censor_detect_v1.0_s/model.pt |
MIT | 22.4 MB |
selfie_multiclass_256x256.tflite |
MediaPipe selfie multiclass segmenter (Google), unchanged | Apache-2.0 | 16.4 MB |
Exact sizes and SHA-256 hashes are in SHA256SUMS.
Detectors (the four YOLOv8 files)
- Input:
[1, 640, 640, 3]float32, RGB scaled to 0..1, NHWC. Fit the picture inside the square without stretching it, and fill the rest with grey (114, 114, 114), as Ultralytics does. - Output:
[1, 4 + classes, 8400]float32. For each of the 8400 anchors there are four box values (centre x, centre y, width, height, in pixels of the 640 square) and then one score per class (0..1, sigmoid already applied). There is no built-in NMS: keep the boxes above your threshold, then run non-maximum suppression. - Shapes are fixed. The LiteRT GPU delegate rejects models with dynamic tensors, so every tensor has a fixed size. Weights are float16; the graph runs in float32 on the CPU and float16 on the GPU.
NudeNet classes, in output order:
0 FEMALE_GENITALIA_COVERED 6 ANUS_EXPOSED 12 FACE_MALE
1 FACE_FEMALE 7 FEET_EXPOSED 13 BELLY_EXPOSED
2 BUTTOCKS_EXPOSED 8 BELLY_COVERED 14 MALE_GENITALIA_EXPOSED
3 FEMALE_BREAST_EXPOSED 9 FEET_COVERED 15 ANUS_COVERED
4 FEMALE_GENITALIA_EXPOSED 10 ARMPITS_COVERED 16 FEMALE_BREAST_COVERED
5 MALE_BREAST_EXPOSED 11 ARMPITS_EXPOSED 17 BUTTOCKS_COVERED
Anime censor classes, in output order: 0 nipple_f, 1 penis, 2 pussy. These two models
are made for anime, cartoons and illustrations, not photos.
Skin segmenter
selfie_multiclass_256x256.tflite is Google's MediaPipe model, unchanged. It is copied here so
that all the app's downloads come from one pinned place. Original:
https://storage.googleapis.com/mediapipe-models/image_segmenter/selfie_multiclass_256x256/float32/latest/selfie_multiclass_256x256.tflite.
- Input:
[1, 256, 256, 3]float32, RGB scaled to -1..1. - Output:
[1, 256, 256, 6], a score per pixel for: background, hair, body skin, face skin, clothes, other.
BlurGuard uses the body-skin class to cover bare arms, legs and shoulders while leaving the face visible.
How the detectors were converted
convert.py shows each step:
- Ultralytics
export(format="onnx", imgsz=640, dynamic=False, simplify=True, opset=17). onnx2tf -tb tf_converter -b 1. The TensorFlow Lite converter backend writes fixed shapes.- The float16 output (
*_float16.tflite) was kept. - Check: run each TFLite file on the LiteRT CPU interpreter and the ONNX file on ONNX Runtime, using the same letterboxed test pictures. Compare the class scores.
| File | Largest score difference against ONNX |
|---|---|
nudenet_320n_640_fp16.tflite |
0.0029 |
nudenet_640m_640_fp16.tflite |
0.0009 |
anime_censor_n_640_fp16.tflite |
0.0008 |
anime_censor_s_640_fp16.tflite |
0.0011 |
Tools: Ultralytics 8.4.182, onnx 1.20.1, onnx2tf 2.6.9, TensorFlow 2.21.0, ai-edge-litert 2.1.2, ONNX Runtime 1.26.0.
Intended use and limits
These models are for on-device content filtering, such as parental controls. They make mistakes. They miss some content, especially when it is small, blurry, partly hidden or drawn. They also cover some harmless content. NudeNet's face classes guess gender from appearance, so they will be wrong for some people. Do not use them for any decision about a person.
Licenses
- The NudeNet files are derived from AGPL-3.0 weights and stay under AGPL-3.0 (licenses/AGPL-3.0.txt). The only change is the format conversion described above.
- The anime censor files are derived from MIT-licensed weights and stay under MIT (licenses/MIT-anime_censor_detection.txt).
- The MediaPipe file is under Apache-2.0 (licenses/Apache-2.0.txt).
- Downloads last month
- -