Skip to content

Instantly share code, notes, and snippets.

@geek-at
Created August 10, 2020 00:33
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Python example for nsfw-categorize.it
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