PHPackages                             alisoleimani/nsfw-detector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. alisoleimani/nsfw-detector

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

alisoleimani/nsfw-detector
==========================

nsfw detector php

v1.0.2(3y ago)148[1 issues](https://github.com/alisoleimanii/nsfw/issues)MITPHP

Since Jun 21Pushed 3y ago2 watchersCompare

[ Source](https://github.com/alisoleimanii/nsfw)[ Packagist](https://packagist.org/packages/alisoleimani/nsfw-detector)[ RSS](/packages/alisoleimani-nsfw-detector/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

NSFW DETECTOR
=============

[](#nsfw-detector)

NSFW (Not Safe for Work) Detector actually is a python script but its integrated with php

Installation
------------

[](#installation)

### Python Installation

[](#python-installation)

```
    pip install --upgrade TensorFlow
    pip install nsfw-detector
```

### PHP Installation

[](#php-installation)

```
    composer require alisoleimani/nsfw-detector
```

Usage/Examples
--------------

[](#usageexamples)

### Basic Usage

[](#basic-usage)

```
$filePath = "path-to-file/file.png";
$data = NSFW::predict($filePath);

// data will be like
// {'drawings': 0.0024894224479794502, 'hentai': 0.0009175422019325197, 'neutral': 0.9905469417572021, 'porn': 0.00509273586794734, 'sexy': 0.0009534107521176338}
// The higher these values, the more likely the photo is to be unsafe
```

#### Don`t Panic! You can use detect method for a boolean value then say image is safe or not

[](#dont-panic-you-can-use-detect-method-for-a-boolean-value-then-say-image-is-safe-or-not)

```
$filePath = "path-to-file/file.png";
$situation = NSFW::detect($filePath);

// if $sitation is true it means image is not safe and if its false image will be secure
```

Authors
-------

[](#authors)

- [Aliakbar Soleimani](https://www.github.com/alisoleimanii)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

1421d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c5fcfc550ab4781f6ea3feffd58812de84e2245fc4286fad68b5c8272d20506a?d=identicon)[alisoleimani.dev](/maintainers/alisoleimani.dev)

---

Top Contributors

[![v8enginephp](https://avatars.githubusercontent.com/u/87603029?v=4)](https://github.com/v8enginephp "v8enginephp (6 commits)")[![alisoleimanii](https://avatars.githubusercontent.com/u/40999152?v=4)](https://github.com/alisoleimanii "alisoleimanii (1 commits)")

---

Tags

nsfw phpnude detector phpporm detector php

### Embed Badge

![Health badge](/badges/alisoleimani-nsfw-detector/health.svg)

```
[![Health](https://phpackages.com/badges/alisoleimani-nsfw-detector/health.svg)](https://phpackages.com/packages/alisoleimani-nsfw-detector)
```

###  Alternatives

[marcosh/lamphpda

A collection of functional programming data structures

12313.5k4](/packages/marcosh-lamphpda)[malarzm/collections

Various implementations of Doctrine's Collection interface

2368.1k](/packages/malarzm-collections)[nben/filament-record-nav

Next/Previous record navigation for Filament PHP

105.0k](/packages/nben-filament-record-nav)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
