Extension:MachineVision

From mediawiki.org
MediaWiki extensions manual
MachineVision
Release status: beta
Implementation Data extraction, Database
Description Supports retrieving, storing, and serving machine vision-generated annotations for Commons images
Author(s) Wikimedia Product Infrastructure and Structured Data teams
Latest version 0.1.0
Compatibility policy Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki 1.34+
Database changes Yes
Tables machine_vision_provider
machine_vision_image
machine_vision_label
machine_vision_suggestion
machine_vision_freebase_mapping
machine_vision_safe_search
License GNU General Public License 2.0 or later
Download
README.md
  • $wgMachineVisionCategoryBlacklist
  • $wgMachineVisionLabelRequestBackoffSeconds
  • $wgMachineVisionHandlers
  • $wgMachineVisionGoogleCredentialsFileLocation
  • $wgMachineVisionNewUploadLabelingJobDelay
  • $wgMachineVisionAddToolboxLink
  • $wgMachineVisionRequestLabelsOnUploadComplete
  • $wgMachineVisionRequestLabelsFromWikidataPublicApi
  • $wgMachineVisionLabelRequestNumRetries
  • $wgMachineVisionHttpProxy
  • $wgMachineVisionGoogleApiCredentials
  • $wgMachineVisionMaxExistingDepictsStatements
  • $wgMachineVisionMinImageWidth
  • $wgMachineVisionGoogleSafeSearchLimits
  • $wgMachineVisionGCVSendFileContents
  • $wgMachineVisionDatabase
  • $wgMachineVisionShowUploadWizardCallToAction
  • $wgMachineVisionWithholdImageList
  • $wgMachineVisionCluster
  • $wgMachineVisionTestersOnly
  • $wgMachineVisionWikidataIdBlacklist
  • $wgMachineVisionTemplateBlacklist
Quarterly downloads 0
Translate the MachineVision extension if it is available at translatewiki.net
Vagrant role machinevision
Issues Open tasks · Report a bug

The MachineVision extension supports collecting data about Commons images from internal and external machine vision services and storing it for on-wiki usage.

For details on the project, see Wikimedia Product/Machine vision middleware.

Functionality[edit]

MachineVision provides the following:

Get image labels of given pages[edit]

  • Provides an interface to fetch image labels as prop of the given pages
  • Exposes an Action API module, query+imagelabels (action=query&prop=imagelabels&titles=File:Example.jpg)

Get unreviewed image labels[edit]

  • Provides an interface to fetch unreviewed image labels grouped by files
  • Exposes an Action API module, query+unreviewedimagelabels (action=query&generator=unreviewedimagelabels&ilstate=unreviewed&prop=imagelabels)
    • Other possible parameters for this API module are:
      • guillimit - default is 10
      • uselang - default is "en"

Get Unreviewed image count[edit]

  • Provides an interface to fetch the total of unreviwed images for the logged in user
  • Exposes an Action API module, query+unreviewedimagecount (action=query&meta=unreviewedimagecount)

Review Image Labels[edit]

  • Provides an interface to change the state of a given label
  • Exposes an Action API module, reviewimagelabels, that receives a POST verb with the following parameters:
    • action=reviewimagelabels
    • filename=Example.jpg
    • batch=[{"label":"Q123", "review":"reject"}, {"label":"Q321", "review":"accept"}] batch of objects containing a map of Q ids and their reviews
  • NOTE: Wikidata Depicts (P180) claims must be added through a separate API request to wbsetclaim.

Installation[edit]

  • Download and place the file(s) in a directory called MachineVision in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'MachineVision' );
    
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.


Vagrant installation:

  • If using Vagrant , install with vagrant roles enable machinevision --provision

Configuration[edit]

To configure the extension, please refer to the Configuration section of the extension's README file as well as the list of configuration variables in the extension.json file.

See also[edit]