Giter Club home page Giter Club logo

image-keyworder's Introduction

Image-KeyWorder

Simple python script that uses Clarifai API to generate keywords and append them to images. Stock-photography use case.

Python script for adding keywords to image meta-data. This script uses Clarifai API to generate keywords based on their pre-trained image recognition models.

The overall goal of this script is to help automate image workflow preparation for stock photography websites such as Alamy which require tags/keywords that describe images.

This script saves generated keywords to image meta-data which are recognised by stock photography websites and are imported automatically (saving photographers time by not having to enter keywords manually).

To get started you need:

  1. Clone the repo

  2. Clarifai account at: clarifai.com (it's free), once registered, create an app and generate API key

  • create new file "cred.py" in the app root directory and insert this line into that file: key="YOUR API KEY HERE"
  • save the file
  1. Install Libraries:
  • pip3 install clarifai
  • pip3 install iptcinfo3
  • pip3 install pillow

have fun...

image-keyworder's People

Contributors

pablo-01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

image-keyworder's Issues

not working error trying to "app = ClarifaiApp(api_key=..."

Is this still working today?
I get this:

Traceback (most recent call last):

  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2\plugins\python-ce\helpers\pydev\pydevd.py", line 1546, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "C:\Users\Chupi\PycharmProjects\imageDB\main.py", line 10, in <module>
    getImageKeywords(dwGalleryPath + "images/small/" + "20200206_MG_3681_Edit.jbg")
  File "C:\Users\Chupi\PycharmProjects\imageDB\keyworder.py", line 12, in getImageKeywords
    app = ClarifaiApp(api_key="<this is may key...>")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chupi\PycharmProjects\imageDB\venv\Lib\site-packages\clarifai\rest\client.py", line 124, in __init__
    self.models = Models(self.api, self.solutions)  # type: Models
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chupi\PycharmProjects\imageDB\venv\Lib\site-packages\clarifai\rest\client.py", line 1068, in __init__
    self.model_id_cache = self.init_model_cache()
                          ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chupi\PycharmProjects\imageDB\venv\Lib\site-packages\clarifai\rest\client.py", line 1086, in init_model_cache
    for m in models:
  File "C:\Users\Chupi\PycharmProjects\imageDB\venv\Lib\site-packages\clarifai\rest\client.py", line 1193, in get_all
    res = self.api.get_models(page, per_page)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chupi\PycharmProjects\imageDB\venv\Lib\site-packages\clarifai\rest\client.py", line 3942, in get_models
    response = self._grpc_request(self._grpc_stub().ListModels,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chupi\PycharmProjects\imageDB\venv\Lib\site-packages\clarifai\rest\client.py", line 3647, in _grpc_request
    res = method(argument)
          ^^^^^^^^^^^^^^^^
  File "C:\Users\Chupi\PycharmProjects\imageDB\venv\Lib\site-packages\clarifai\rest\grpc\grpc_json_channel.py", line 171, in __call__
    result = dict_to_protobuf(message, response_json, ignore_unknown_fields=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chupi\PycharmProjects\imageDB\venv\Lib\site-packages\clarifai\rest\grpc\custom_converters\custom_dict_to_message.py", line 25, in dict_to_protobuf
    parser.ConvertMessage(js_dict, message)
TypeError: _Parser.ConvertMessage() missing 1 required positional argument: 'path'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.