Skip to content

Instantly share code, notes, and snippets.

@geek-at
Created August 10, 2020 00:33
Show Gist options
  • Select an option

  • Save geek-at/83408cc72816c39914c47cf5e11bf9b1 to your computer and use it in GitHub Desktop.

Select an option

Save geek-at/83408cc72816c39914c47cf5e11bf9b1 to your computer and use it in GitHub Desktop.

Revisions

  1. geek-at created this gist Aug 10, 2020.
    9 changes: 9 additions & 0 deletions example.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    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"]))