ccp.docs/source/developermanual/ccp_methods/Gate Cloud Multilingual Ima...

149 lines
5.5 KiB
JSON

{
"title": "Gate Cloud Multilingual Image Ocr",
"description": "Service that uses optical character recognition (OCR) to identify text contained within images. This is a multi-lingual service and not restricted to Latin scripts. It works in three stages. First it determines the bounding boxes of related text within the image. Secondly it extracts the text from within each bounding box, before finally determining the language of the extracted text. Two output CSV files are returned, one with one row per image giving the primary detected script for that image, and another with one row per bounding box giving the extracted text - for full details see https://cloud.gate.ac.uk/shopfront/displayItem/ml-ocr",
"version": "1.0.0",
"jobControlOptions": "async-execute",
"metadata": [
{
"title": "Marco Lettere",
"role": "author",
"href": "https://accounts.dev.d4science.org/auth/admin/realms/d4science/users/88c76e47-5881-4716-a2bf-02d3b4073574"
},
{
"role": "category",
"title": "Image_Analysis_And_OCR"
}
],
"inputs": {
"ccpimage": {
"id": "ccpimage",
"title": "Runtime",
"description": "The image of the runtime to use for method execution. This depends on the infrastructure specific protocol for interacting with registries.",
"minOccurs": 1,
"maxOccurs": 1,
"schema": {
"type": "string",
"format": "url",
"contentMediaType": "text/plain",
"default": "hub.dev.d4science.org/ccp-runtimes/gatecloud-base:latest",
"readOnly": true
}
},
"inputItem": {
"id": "inputItem",
"title": "inputItem",
"description": "Either a single image or a folder containing images to process [ITEMID]()",
"minOccurs": 1,
"maxOccurs": 1,
"schema": {
"type": "string",
"format": "none",
"default": ""
}
},
"recursive": {
"id": "recursive",
"title": "recursive",
"description": "If inputItem is a folder, should we recurse into sub-folders (true) or process only images directly in the specified folder (false)?()",
"minOccurs": 1,
"maxOccurs": 1,
"schema": {
"type": "string",
"format": "boolean",
"default": "false"
}
},
"patterns": {
"id": "patterns",
"title": "patterns",
"description": "If inputItem is a folder, one or more glob patterns for files to process, separated by commas()",
"minOccurs": 1,
"maxOccurs": 1,
"schema": {
"type": "string",
"format": "none",
"default": "*.png, *.jpg"
}
},
"script": {
"id": "script",
"title": "script",
"description": "Specify a particular script for the OCR service, or use the default behaviour of detecting the script for each block of text automatically.()",
"minOccurs": 1,
"maxOccurs": 1,
"schema": {
"type": "string",
"enum": [
"Auto Detect (Single Script)",
"Auto Detect (Multiple Scripts)",
"Arabic",
"Bengali-Assamese",
"Cyrillic",
"Devanagari",
"Han (simplified variant)",
"Han (traditional variant)",
"Hangul",
"Han, Hiragana, and Katakana",
"Latin",
"Tamil",
"Telugu"
],
"default": "Auto Detect (Single Script)"
}
}
},
"outputs": {
"scriptsCsv": {
"id": "scriptsCsv",
"title": "scriptsCsv",
"description": "Summary output file with one row per processed image, giving the main script for that image as well as any errors that occurred during processing.",
"minOccurs": 1,
"maxOccurs": 1,
"metadata": [
{
"title": "scripts.csv",
"role": "file",
"href": "/ccp_data/output/scripts.csv"
}
],
"schema": {
"type": "string",
"contentEncoding": "binary",
"contentMediaType": "text/csv"
}
}
},
"additionalParameters": {
"parameters": [
{
"name": "deploy-script",
"value": [
""
]
},
{
"name": "execute-script",
"value": [
"python build/ml-ocr/ocr_service.py {{inputItem}} {{recursive}} '{{patterns}}' '{{script}}'",
"cp -f result.csv scripts.csv /ccp_data/"
]
},
{
"name": "undeploy-script",
"value": []
}
]
},
"links": [
{
"rel": "compatibleWith",
"title": "D4Science development Infrastructure",
"href": "infrastructures/d4science-dev-swarm"
}
],
"keywords": [
"gatecloud"
],
"id": "90b17b0c-d5c8-4202-8ef3-02ac997f4ff4"
}