General approach to developing an image classification algorithm for Dilbert cartoons

后端 未结 4 1259
旧时难觅i
旧时难觅i 2021-01-30 04:13

As a self-development exercise, I want to develop a simple classification algorithm that, given a particular cell of a Dilbert cartoon, is able to identify which characters are

4条回答
  •  悲哀的现实
    2021-01-30 05:05

    You can try building a model by uploading your training data (images of comics) to demo.nanonets.ai (free to use)

    Then query the API using the following (Python Code):

    import requests
    import json
    import urllib
    model_name = "Enter-Your-Model-Name-Here"
    url = "http://static5.businessinsider.com/image/525464f969bedd0b0422cfb6/dilbert-creator-scott-adams-presents-his-10-favorite-comics-of-all-time.jpg"
    files = {'uploadfile': urllib.urlopen(url).read()}
    url = "http://demo.nanonets.ai/classify/?appId="+model_name
    r = requests.post(url, files=files)
    print json.loads(r.content)
    

    the response looks like:

    {
      "message": "Model trained",
      "result": [
        {
          "label": "Dilbert",
          "probability": 0.97
        },
        {
          "label": "PHB",
          "probability": 0.025
        },
        {
          "label": "Ratbert",
          "probability": 0.005
        }
      ]
    }
    

提交回复
热议问题