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
License GNU General Public License 2.0 or later
Download
README.md
Parameters
  • $wgMachineVisionCategoryBlacklist
  • $wgMachineVisionLabelRequestBackoffSeconds
  • $wgMachineVisionHandlers
  • $wgMachineVisionGoogleCredentialsFileLocation
  • $wgMachineVisionNewUploadLabelingJobDelay
  • $wgMachineVisionAddToolboxLink
  • $wgMachineVisionRequestLabelsOnUploadComplete
  • $wgMachineVisionRequestLabelsFromWikidataPublicApi
  • $wgMachineVisionLabelRequestNumRetries
  • $wgMachineVisionHttpProxy
  • $wgMachineVisionGoogleApiCredentials
  • $wgMachineVisionMaxExistingDepictsStatements
  • $wgMachineVisionMinImageWidth
  • $wgMachineVisionGoogleSafeSearchLimits
  • $wgMachineVisionGCVSendFileContents
  • $wgMachineVisionDatabase
  • $wgMachineVisionShowUploadWizardCallToAction
  • $wgMachineVisionWithholdImageList
  • $wgMachineVisionCluster
  • $wgMachineVisionTestersOnly
  • $wgMachineVisionWikidataIdBlacklist
  • $wgMachineVisionTemplateBlacklist
Hooks used
  • BeforeCreateEchoEvent
  • ChangeTagsAllowedAdd
  • ChangeTagsListActive
  • EchoGetBundleRules
  • FileDeleteComplete
  • GetPreferences
  • InfoAction
  • ListDefinedTags
  • LoadExtensionSchemaUpdates
  • PageSaveComplete
  • RollbackComplete
  • SidebarBeforeOutput
  • UnitTestsAfterDatabaseSetup
  • UnitTestsBeforeDatabaseTeardown
  • UploadComplete
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

MachineVision provides the following:

Get image labels of given pages

  • 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

  • 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

  • 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

  • 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

  • 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

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

This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.