**Looking for contributors/ maintainers for this repo**:
I have become busy with other stuff in the last years, still trying to maintain this repo as it is the current best OSS option for nudity detection,
Looking for interested mainttainer, who can add/ work on more features for this repo (with my help of course)
# NudeNet: lightweight Nudity detection
https://nudenet.notai.tech/ in-browser demo (the detector is run client side, i.e: in your browser, images are not sent to a server)
```bash
pip install --upgrade "nudenet>=3.4.2"
```
```python
from nudenet import NudeDetector
detector = NudeDetector()
# the 320n model included with the package will be used
detector.detect('image.jpg') # Returns list of detections
detector.detect_batch(['image_1.jpg', 'image_2.jpg']) # Returns list of [list of detections]
```
- [Python package example in colab](https://colab.research.google.com/drive/1WChIMZ9Yzseije3Oj-Ye-cGCMLw8azvZ?usp=sharing)
- `detect` and `detect_batch` accept file path(s), opencv image(s), image bytes(s), open(image_path, 'rb') (buffereader) objects
#### Available models
| Model | resolution trained | based on | onnx link | pytorch link |
| --- | --- | --- | --- | -- |
| 320n | 320x320 | ultralytics yolov8n | [link](https://github.com/notAI-tech/NudeNet/releases/download/v3.4-weights/320n.onnx) | [link](https://github.com/notAI-tech/NudeNet/releases/download/v3.4-weights/320n.pt)
| 640m | 640x640 | ultralytics yolov8m | [link](https://github.com/notAI-tech/NudeNet/releases/download/v3.4-weights/640m.onnx) | [link](https://github.com/notAI-tech/NudeNet/releases/download/v3.4-weights/640m.pt)
```python
# To use the 640m model, download the onnx file and pass the path to the model_path argument
detector = NudeDetector(model_path="downloaded_640m.onnx path", inference_resolution=640)
```
- 320n is the default model and is included in the `nudenet` python package by default
```python
detection_example = [
{'class': 'BELLY_EXPOSED',
'score': 0.799403190612793,
'box': [64, 182, 49, 51]},
{'class': 'FACE_FEMALE',
'score': 0.7881264686584473,
'box': [82, 66, 36, 43]},
]
```
```python
nude_detector.censor('image.jpg') # returns censored image output path
# optional censor(self, image_path, classes=[], output_path=None) classes and output_path can be passed
```
```python
all_labels = [
"FEMALE_GENITALIA_COVERED",
"FACE_FEMALE",
"BUTTOCKS_EXPOSED",
"FEMALE_BREAST_EXPOSED",
"FEMALE_GENITALIA_EXPOSED",
"MALE_BREAST_EXPOSED",
"ANUS_EXPOSED",
"FEET_EXPOSED",
"BELLY_COVERED",
"FEET_COVERED",
"ARMPITS_COVERED",
"ARMPITS_EXPOSED",
"FACE_MALE",
"BELLY_EXPOSED",
"MALE_GENITALIA_EXPOSED",
"ANUS_COVERED",
"FEMALE_BREAST_COVERED",
"BUTTOCKS_COVERED",
]
```
### Docker
```bash
docker run -it -p8080:8080 ghcr.io/notai-tech/nudenet:latest
```
```bash
curl -F f1=@"images.jpeg" "http://localhost:8080/infer"
{"prediction": [[{"class": "BELLY_EXPOSED", "score": 0.8511635065078735, "box": [71, 182, 31, 50]}, {"class": "FACE_FEMALE", "score": 0.8033977150917053, "box": [83, 69, 21, 37]}, {"class": "FEMALE_BREAST_EXPOSED", "score": 0.7963727712631226, "box": [85, 137, 24, 38]}, {"class": "FEMALE_BREAST_EXPOSED", "score": 0.7709134817123413, "box": [63, 136, 20, 37]}, {"class": "ARMPITS_EXPOSED", "score": 0.7005534172058105, "box": [60, 127, 10, 20]}, {"class": "FEMALE_GENITALIA_EXPOSED", "score": 0.6804671287536621, "box": [81, 241, 14, 24]}]], "success": true}⏎
```
#### Some interesting projects based on NudeNet
1 - by https://github.com/w-e-w, censor extension ps://github.com/notAI-tech/NudeNet/issues/131
Raw data
{
"_id": null,
"home_page": "https://github.com/notAI-tech/nudenet",
"name": "nudenet",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6.0",
"maintainer_email": null,
"keywords": null,
"author": "BEDAPUDI PRANEETH",
"author_email": "praneeth@bpraneeth.com",
"download_url": "https://files.pythonhosted.org/packages/04/8f/9e4862f004f648d240039ebffda2441d230741c164efaa25038051b56c60/nudenet-3.4.2.tar.gz",
"platform": null,
"description": "\n**Looking for contributors/ maintainers for this repo**: \nI have become busy with other stuff in the last years, still trying to maintain this repo as it is the current best OSS option for nudity detection,\nLooking for interested mainttainer, who can add/ work on more features for this repo (with my help of course)\n\n# NudeNet: lightweight Nudity detection\n\nhttps://nudenet.notai.tech/ in-browser demo (the detector is run client side, i.e: in your browser, images are not sent to a server)\n\n```bash\npip install --upgrade \"nudenet>=3.4.2\"\n```\n\n```python\nfrom nudenet import NudeDetector\ndetector = NudeDetector()\n# the 320n model included with the package will be used\n\ndetector.detect('image.jpg') # Returns list of detections\n\ndetector.detect_batch(['image_1.jpg', 'image_2.jpg']) # Returns list of [list of detections]\n```\n\n- [Python package example in colab](https://colab.research.google.com/drive/1WChIMZ9Yzseije3Oj-Ye-cGCMLw8azvZ?usp=sharing)\n\n- `detect` and `detect_batch` accept file path(s), opencv image(s), image bytes(s), open(image_path, 'rb') (buffereader) objects\n\n#### Available models\n\n| Model | resolution trained | based on | onnx link | pytorch link |\n| --- | --- | --- | --- | -- |\n| 320n | 320x320 | ultralytics yolov8n | [link](https://github.com/notAI-tech/NudeNet/releases/download/v3.4-weights/320n.onnx) | [link](https://github.com/notAI-tech/NudeNet/releases/download/v3.4-weights/320n.pt)\n| 640m | 640x640 | ultralytics yolov8m | [link](https://github.com/notAI-tech/NudeNet/releases/download/v3.4-weights/640m.onnx) | [link](https://github.com/notAI-tech/NudeNet/releases/download/v3.4-weights/640m.pt)\n\n```python\n# To use the 640m model, download the onnx file and pass the path to the model_path argument\n\ndetector = NudeDetector(model_path=\"downloaded_640m.onnx path\", inference_resolution=640)\n```\n\n- 320n is the default model and is included in the `nudenet` python package by default\n\n\n```python\ndetection_example = [\n {'class': 'BELLY_EXPOSED',\n 'score': 0.799403190612793,\n 'box': [64, 182, 49, 51]},\n {'class': 'FACE_FEMALE',\n 'score': 0.7881264686584473,\n 'box': [82, 66, 36, 43]},\n ]\n```\n\n```python\nnude_detector.censor('image.jpg') # returns censored image output path\n\n# optional censor(self, image_path, classes=[], output_path=None) classes and output_path can be passed\n```\n\n```python\nall_labels = [\n \"FEMALE_GENITALIA_COVERED\",\n \"FACE_FEMALE\",\n \"BUTTOCKS_EXPOSED\",\n \"FEMALE_BREAST_EXPOSED\",\n \"FEMALE_GENITALIA_EXPOSED\",\n \"MALE_BREAST_EXPOSED\",\n \"ANUS_EXPOSED\",\n \"FEET_EXPOSED\",\n \"BELLY_COVERED\",\n \"FEET_COVERED\",\n \"ARMPITS_COVERED\",\n \"ARMPITS_EXPOSED\",\n \"FACE_MALE\",\n \"BELLY_EXPOSED\",\n \"MALE_GENITALIA_EXPOSED\",\n \"ANUS_COVERED\",\n \"FEMALE_BREAST_COVERED\",\n \"BUTTOCKS_COVERED\",\n]\n```\n\n\n### Docker\n\n```bash\ndocker run -it -p8080:8080 ghcr.io/notai-tech/nudenet:latest\n```\n\n```bash\ncurl -F f1=@\"images.jpeg\" \"http://localhost:8080/infer\"\n\n{\"prediction\": [[{\"class\": \"BELLY_EXPOSED\", \"score\": 0.8511635065078735, \"box\": [71, 182, 31, 50]}, {\"class\": \"FACE_FEMALE\", \"score\": 0.8033977150917053, \"box\": [83, 69, 21, 37]}, {\"class\": \"FEMALE_BREAST_EXPOSED\", \"score\": 0.7963727712631226, \"box\": [85, 137, 24, 38]}, {\"class\": \"FEMALE_BREAST_EXPOSED\", \"score\": 0.7709134817123413, \"box\": [63, 136, 20, 37]}, {\"class\": \"ARMPITS_EXPOSED\", \"score\": 0.7005534172058105, \"box\": [60, 127, 10, 20]}, {\"class\": \"FEMALE_GENITALIA_EXPOSED\", \"score\": 0.6804671287536621, \"box\": [81, 241, 14, 24]}]], \"success\": true}\u23ce\n```\n\n#### Some interesting projects based on NudeNet\n1 - by https://github.com/w-e-w, censor extension ps://github.com/notAI-tech/NudeNet/issues/131\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Lightweight Nudity Detection",
"version": "3.4.2",
"project_urls": {
"Homepage": "https://github.com/notAI-tech/nudenet"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1cee1aa02d44ba958cc77e16ff1e41a0aac5e721037db7bf62b9c9d124917f87",
"md5": "3b385d868192938c1225d570b670b04e",
"sha256": "5937dbd84e5d8e5de038f08ffea5a1bb50a08475776bf2b4795914ce0eaf0331"
},
"downloads": -1,
"filename": "nudenet-3.4.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3b385d868192938c1225d570b670b04e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6.0",
"size": 10595223,
"upload_time": "2024-07-03T17:32:02",
"upload_time_iso_8601": "2024-07-03T17:32:02.780066Z",
"url": "https://files.pythonhosted.org/packages/1c/ee/1aa02d44ba958cc77e16ff1e41a0aac5e721037db7bf62b9c9d124917f87/nudenet-3.4.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "048f9e4862f004f648d240039ebffda2441d230741c164efaa25038051b56c60",
"md5": "b10d633fbe94c118ea4e5422df219c8a",
"sha256": "b20645d5f06bbb10006e6d4dc8a9513cf684269bbcffb0557a3ed6831aa90d75"
},
"downloads": -1,
"filename": "nudenet-3.4.2.tar.gz",
"has_sig": false,
"md5_digest": "b10d633fbe94c118ea4e5422df219c8a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.0",
"size": 10596676,
"upload_time": "2024-07-03T17:32:05",
"upload_time_iso_8601": "2024-07-03T17:32:05.792416Z",
"url": "https://files.pythonhosted.org/packages/04/8f/9e4862f004f648d240039ebffda2441d230741c164efaa25038051b56c60/nudenet-3.4.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-03 17:32:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "notAI-tech",
"github_project": "nudenet",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "nudenet"
}