Giter VIP home page Giter VIP logo

taghound-media-tagger's Introduction

Taghound Media Tagger

Contributors: jplhomer
Tags: media gallery, tagging, images, deep learning, neural network, admin
Requires at least: 3.9
Requires PHP: 5.5
Tested up to: 4.9.1
Stable tag: 2.0.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Automatically tag and search images in your media library using Clarifai's object recognition API.

Description

Automatically tag and search images in your media library using Clarifai's object recognition API. Using advances in deep learning, Clarifai leverages convoluted neural networks to analyze an image and return predictions of the contents of that image.

Typically, your images will be tagged with simple indicators like:

  • one person
  • no people
  • happy
  • man/woman
  • outdoors
  • tree

Taghound Media Tagger takes these predictions and turns them into WordPress tags. This enables you to immediately search for images you've added to your media library by the contents of the image and not by the title or description you have manually entered.

Taghound Media Tagger lets you tag new images in addition to a backlog of older images you added before installing the plugin!

Features

  • Automatically tag images in your media gallery with predicted contents
  • Search for the contents of images using the Media Gallery search input
  • Filter your media gallery by a specific tag
  • Tag existing images in your media library with the click of a button

Coming Soon

We're always looking to improve Taghound Media Tagger. Here's what is on the roadmap:

  • Tag videos in addition to photos

Github

This plugin is open-source and available on Github. Please consider contributing to the plugin if you find bugs or have a feature you'd like to see implemented:

https://github.com/jplhomer/taghound-media-tagger

Build Status

Website

http://jplhomer.org/projects/taghound-media-tagger/

Art

Special thanks to Kevin Fish for his work on the TagHound logo and banner!

Installation

  1. NOTE: You must have PHP 5.5 or greater installed on your server to activate the plugin. Ask your web host about this if you are unsure.
  2. Upload 'taghound-media-tagger' to the '/wp-content/plugins/' directory
  3. Activate the plugin through the 'Plugins' menu in WordPress
  4. Visit the Clarifai Developer Portal and create a free or paid account
  5. Create an application with Clarifai, and copy the API Key from the developer portal
  6. Visit the Taghound settings page under Settings
  7. Paste in the API Key from step 4 and click "Save Changes"
  8. On the same page, click the checkbox "Enable for all new Images" to have Taghound Media Tagger begin tagging new images!

Frequently Asked Questions

Q. How do my images get analyzed by Clarifai?

A. Taghound Media Tagger sends each of your images over HTTPS to Clarifai after they've been uploaded to your media gallery.

Q. What does Clarifai do with my images?

A. Clarifai processes your images and returns a list of associated keywords. Additionally, Clarifai stores images to further train its models and increase the accuracy of future responses. Clarifai does not share your images with third parties.

Q. Does this plugin process images that already exist in my media library?

A. Yes! Visit the Settings > Taghound page and use the Bulk Tagger tool.

Q. What if an image gets tagged with something I don't like?

A. You may untag the image by clicking the 'X'. This is similar to how you would remove a tag from a post.

Q. Can I use this plugin with other 3rd party plugins like Media Library Assistant?

A. Yes! We've provided a hook for you to choose where to store the tags. Pass a function that returns the slug of the taxonomy you'd like to use to tmt_tag_taxonomy inside your theme's functions.php file.

See the documentation here.

We've also tested this with a couple popular media management plugins:

Note that the default user interface for Taghound's tag manipulation will be hidden when you've chosen an alternate tag taxonomy.

Screenshots

1. Tags are automatically applied to images when added to the media library

Tags are automatically applied to images when added to the media library

2. Tags are searchable from within the media library

Tags are searchable from within the media library

3. Tags are searchable from within the Insert Media modal window when editing a post, too

Tags are searchable from within the Insert Media modal window when editing a post, too

4. Filter media items by a specific tag when using the list view of the media library

Filter media items by a specific tag when using the list view of the media library

Changelog

2.0.2

  • Fixes bug where server would time out during upload-only bulk tagging events
  • Fixes visual bug introduced in tag picker in WordPress 4.9

2.0.1

  • Minor updates to the Readme and required PHP version.

2.0.0

  • FEATURE: Supports v2 of the Clarifai API! You will need to generate an API token to continue using the product.
  • FEATURE: Run the bulk tagger in upload-only mode.
  • Removes support for checking your usage stats in WordPress. Clarifai no longer supports this.

1.2.0

  • FEATURE: Adds the tmt_tag_taxonomy filter to allow users to customize the taxonomy used to store tags

1.1.1

  • Show more detailed error message during Bulk Tagging failure

1.1.0

  • FEATURE: A bulk tagger tags existing images in library
  • FEATURE: Under the hood, sends URL to image assets instead of uploading images individually
  • FEATURE: Moves Taghound settings to a dedicated screen

1.0.4

  • BUGFIX: Adds media browser support back to < WordPress 4.7

1.0.3

  • Removes cruft added to last build.

1.0.2

  • Updates admin UI to support WordPress 4.7
  • Adds a minimum required PHP version of 5.5.

1.0.1

  • FEATURE: See Clarifai API usage data under Media settings.

1.0.0

  • Taghound Media Tagger.

Upgrade Notice

2.0.0

This version supports the Clarifai v2 API, since v1 is now deprecated. You will need to create an API token to continue using Taghound!

taghound-media-tagger's People

Contributors

jplhomer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

incidunt

taghound-media-tagger's Issues

Use the largest image size instead of the original image

Use the wp_get_attachment_metadata function to glean the largest image size that's not the full image. Then create the file path using the uploads directory utility and send that to Clarifai.

This should help speed and prevent sending massive files to Clarifai.

Only thing I'm worried about is an image where thumbnail is the only size and it's teeny tiny.

Needs settings page

There should be a settings page. To begin with, it can include:

  • Clarifai Client ID
  • Clarifai Client Secret
  • Enable Photo Auto-Tagging

Add back support for < WordPress 4.7

With the release of v1.0.2, I broke support for anything less than 4.7.

Seems to be an issue with adding new dependencies for tmt-tags-box.js.

Working on it in the batch tagger branch now.

Suggest results reappear after modal is closed

  • Happens only in media upload page
  • Reproduce by opening up an attachment modal, triggering the suggest autocomplete, then hitting ESC twice to close the modal.

Tried overriding the Backbone view's escapeHandler function to no avail.
screenshot 2016-05-30 17 57 17

Handling Errors

What happens if we hit our rate limit during an upload? Monthly bandwidth usage?

Do we store a local setting with current errors - along with a messaging class?

Let's write some tests and make some UI decisions.

Uncaught TypeError: Cannot read property ‘results’ of null

I get the following error when I attempt to begin the tagging process:

Uncaught TypeError: Cannot read property 'results' of null
    at Object.success (tmt-admin.js:56)
    at i (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,jquery-ui-widget,jquery-ui-position,utils,suggest,jquery-ui-menu,wp-a11y,jquery-ui-aut&load[]=ocomplete,tags-suggest,underscore,moxiejs,plupload&ver=4.9.4:2)
    at Object.fireWith [as resolveWith] (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,jquery-ui-widget,jquery-ui-position,utils,suggest,jquery-ui-menu,wp-a11y,jquery-ui-aut&load[]=ocomplete,tags-suggest,underscore,moxiejs,plupload&ver=4.9.4:2)
    at y (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,jquery-ui-widget,jquery-ui-position,utils,suggest,jquery-ui-menu,wp-a11y,jquery-ui-aut&load[]=ocomplete,tags-suggest,underscore,moxiejs,plupload&ver=4.9.4:4)
    at XMLHttpRequest.c (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,jquery-ui-core,jquery-ui-widget,jquery-ui-position,utils,suggest,jquery-ui-menu,wp-a11y,jquery-ui-aut&load[]=ocomplete,tags-suggest,underscore,moxiejs,plupload&ver=4.9.4:4)

Selecting “My website is not publicly accessible” works until I get:

Uncaught TypeError: Cannot read property 'map' of undefined
    at Object.success (tmt-admin.js:56)
    at i (load-scripts.php:2)
    at Object.fireWith [as resolveWith] (load-scripts.php:2)
    at y (load-scripts.php:4)
    at XMLHttpRequest.c (load-scripts.php:4)`

Tagging is now stuck after 83 images.

WordPress 4.9.4 | PHP 7.1.15 | Apache/2.4.29 (Unix) mod_hive/6.6 OpenSSL/1.0.1e-fips mod_fastcgi/2.4.6 | MySQL 5.6.36-82.1-log

Create UI for tagging images

Attachment tags should be checkboxes so the user can remove tags he or she doesn't agree with.

Additionally, a user should be able to add new tags with an input to mark which ones they deem appropriate for that image.

This sets us up to be able to send feedback to Clarifai on a given document.

  • Make the UI expand to fill the modal space and a little bigger on the detail space

Allow users to override tag taxonomy

  • Allows plugin to be used with 3rd party media management plugins

  • Been requested a few times

  • Show notice in Admin UI if taxonomy is custom

  • Disable UI and search if taxonomy is custom

  • Make sure bulk tagging works

  • Test with a few common media libraries

  • Add docs for integrating popular libraries

3rd Party Plugin Slug to Override
Media Library Assistant attachment_tag
Enhanced Media Library media_category

Invalid Argument in Foreach

When Clarifai is unable to process an image the following warning appears
PHP Warning: Invalid argument supplied for foreach() in /.../wp-content/plugins/taghound-media-tagger/lib/class-tagger-service.php on line 47

Add option to upload instead of download

You can either send an encoded form containing a file with a POST request, or send Clarifai a URL of an image. Up to this point, we've been uploading the file by default.

We should implement the other option with the URL as the default. 99% of users will be on a public website when using this plugin. Additionally, Clarifai offers a batch request endpoint for the download method.

By adding a checkbox option, we can allow developers and sites behind a firewall or intranet to push their images instead of having Clarifai download them.

Add back-date tagging feature

This would be great for initial launch, but I feel like we won't hit this milestone.

Things

  • Section shows up when settings entered
  • Says "You have N images without tags"
    • If > hourly limit, show notice that not all images will be used AND cap will be hit for hour
  • If account is limited, disable controls
  • If "Upload only" is checked, disable controls
  • Call to the "Info" endpoint
    • Shows us the recommended wait time, account usage, max images, etc

Go!

  • AJAX to BackDating class
  • Response contains paginated numbers
  • Client sends back boomerang response until done

Prepare for WP Plugin directory submission

I have no idea how to go about this.

Would be nice to use somebody's automated script to sync the repo to SVN and minify, etc.

Todo

  • Finalize name
  • Write out descriptions
  • Fill out Installation instructions on Readme.txt
  • Take Screenshots
  • Create logo and banners for WP repo
  • Create page on jplhomer.org and add documention
  • Submit to WP repository
  • Clone down SVN repo and connect it with Git

"Most Used" tags don't populate

The "Most Used" tags don't populate in the tag UI. This is something related to the wp_popular_terms_checklist() native WordPress function.

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.