Created
August 10, 2020 00:33
-
-
Save geek-at/83408cc72816c39914c47cf5e11bf9b1 to your computer and use it in GitHub Desktop.
Python example for nsfw-categorize.it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
url = 'https://nsfw-categorize.it/api/upload' | |
files = {'image':('1.jpg', open('1.jpg', 'rb'))} | |
r = requests.post(url, files=files) | |
result = json.loads(r.content) | |
if(result["status"]=='OK'): | |
print("This image is classified as "+str(result["data"]["classification"])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment