{"id":19746334,"url":"https://github.com/symisc/pixlab-php-nsfw","last_synced_at":"2025-04-30T08:30:55.100Z","repository":{"id":57063768,"uuid":"145344057","full_name":"symisc/pixlab-php-nsfw","owner":"symisc","description":"PHP Class to classify NSFW content via the PixLab Machine Vision APIs","archived":false,"fork":false,"pushed_at":"2018-08-21T22:55:30.000Z","size":20,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-10T18:09:08.331Z","etag":null,"topics":["computer-vision","machine-learning","machine-learning-api","nsfw","nsfw-recognition","php","rest-api"],"latest_commit_sha":null,"homepage":"https://pixlab.io/cmd?id=nsfw","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/symisc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-19T23:11:53.000Z","updated_at":"2024-04-10T18:09:08.332Z","dependencies_parsed_at":"2022-08-24T10:10:33.933Z","dependency_job_id":null,"html_url":"https://github.com/symisc/pixlab-php-nsfw","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symisc%2Fpixlab-php-nsfw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symisc%2Fpixlab-php-nsfw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symisc%2Fpixlab-php-nsfw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symisc%2Fpixlab-php-nsfw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/symisc","download_url":"https://codeload.github.com/symisc/pixlab-php-nsfw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224202821,"owners_count":17272807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","machine-learning","machine-learning-api","nsfw","nsfw-recognition","php","rest-api"],"created_at":"2024-11-12T02:14:17.926Z","updated_at":"2024-11-12T02:14:18.534Z","avatar_url":"https://github.com/symisc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP NSFW Classifier\n[![GitHub package version](https://img.shields.io/badge/Packagist-Ready-green.svg)](https://packagist.org/packages/symisc/pixlab-php-nsfw)\n\nA **single PHP Class** to classify **NSFW contents** (i.e. Users image uploads) via the PixLab Machine Vision APIs - https://pixlab.io/cmd?id=nsfw\n## Requirements\nPixLab PHP NSFW Class works with PHP 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, and HHVM.\n## Install\nTo install PHP NSFW Class via Composer:\n```shell\n$ composer require symisc/pixlab-php-nsfw\n```\nOr simply drop ***pixlab.php*** on your source tree and you're done!\n## Usage Example\n```php\n\u003c?php\nrequire_once \"pixlab.php\";\n\n# Target Image: Change to any link (Possibly adult) you want or switch to POST \n# if you want to upload your image directly. \n$img = 'https://i.redd.it/oetdn9wc13by.jpg';\n\n# Your PixLab key - Get one from https://pixlab.io/dashboard\n$key = 'My_Pixlab_Key';\n\n# Blur an image based on its NSFW score\n$pix = new Pixlab($key);\n/* Invoke NSFW */\nif( !$pix-\u003eget('nsfw',['img' =\u003e $img]) ){\n\techo $pix-\u003eget_error_message();\n\tdie;\n}\n/* Grab the NSFW score */\n$score = $pix-\u003ejson-\u003escore;\nif( $score \u003c 0.5 ){\n\techo \"No adult content were detected on this picture\\n\";\n}else{\n\techo \"Censuring NSFW picture...\\n\";\n\t/* Call blur with the highest possible radius and sigma */\n\tif( !$pix-\u003eget('blur',array('img' =\u003e $img,'rad' =\u003e 50,'sig' =\u003e30)) ){\n\t\techo $pix-\u003eget_error_message();\n\t}else{\n\t\techo \"Censured Picture: \".$pix-\u003ejson-\u003elink.\"\\n\";\n\t}\n}\n?\u003e\n```\n## PixLab Resources\n[PixLab Resources \u0026amp; Sample Set](https://pixlab.io/examples). The Sample Set are practical usage, working code available in various programming languages intended to familiarize the reader with the PixLab API.\nFor an introduction course, please refer to:\n* [The PixLab API in 5 minutes or less](https://pixlab.io/start).\n* [List of API endpoints](https://pixlab.io/api).\n* [The PixLab API Reference Guide](https://pixlab.io/cmdls).\n* [The PixLab Sample Set](https://pixlab.io/examples).\n\nYou’re welcome to copy/paste and run these examples to see the API in action.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsymisc%2Fpixlab-php-nsfw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsymisc%2Fpixlab-php-nsfw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsymisc%2Fpixlab-php-nsfw/lists"}