From mediawiki.org
MediaWiki extensions manual
OOjs UI icon advanced.svg
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
License GNU General Public License 2.0 or later
  • $wgMachineVisionCategoryBlacklist
  • $wgMachineVisionLabelRequestBackoffSeconds
  • $wgMachineVisionHandlers
  • $wgMachineVisionGoogleCredentialsFileLocation
  • $wgMachineVisionNewUploadLabelingJobDelay
  • $wgMachineVisionAddToolboxLink
  • $wgMachineVisionRequestLabelsOnUploadComplete
  • $wgMachineVisionRequestLabelsFromWikidataPublicApi
  • $wgMachineVisionLabelRequestNumRetries
  • $wgMachineVisionHttpProxy
  • $wgMachineVisionGoogleApiCredentials
  • $wgMachineVisionMaxExistingDepictsStatements
  • $wgMachineVisionMinImageWidth
  • $wgMachineVisionGoogleSafeSearchLimits
  • $wgMachineVisionGCVSendFileContents
  • $wgMachineVisionDatabase
  • $wgMachineVisionShowUploadWizardCallToAction
  • $wgMachineVisionWithholdImageList
  • $wgMachineVisionCluster
  • $wgMachineVisionTestersOnly
  • $wgMachineVisionWikidataIdBlacklist
  • $wgMachineVisionTemplateBlacklist
  • imagelabel-review
  • imagelabel-test
Translate the MachineVision extension if it is available at translatewiki.net

Check usage and version matrix.

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.


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.


  • If using Vagrant , install with vagrant roles enable machinevision --provision
Manual installation
  • 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:
    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.


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]