{"id":19053800,"url":"https://github.com/siddhi-io/siddhi-execution-tensorflow","last_synced_at":"2025-06-12T12:08:31.808Z","repository":{"id":57742275,"uuid":"111528006","full_name":"siddhi-io/siddhi-execution-tensorflow","owner":"siddhi-io","description":"Extension that adds support for inferences from pre-built TensorFlow SavedModels","archived":false,"fork":false,"pushed_at":"2019-12-03T05:37:57.000Z","size":35508,"stargazers_count":4,"open_issues_count":2,"forks_count":17,"subscribers_count":65,"default_branch":"master","last_synced_at":"2025-04-24T03:07:20.715Z","etag":null,"topics":["deep-learning","deep-neural-network","execution","extension","machine-learning","ml","neural-network","siddhi","tensorflow"],"latest_commit_sha":null,"homepage":"https://siddhi-io.github.io/siddhi-execution-tensorflow/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/siddhi-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-21T09:33:22.000Z","updated_at":"2021-02-20T07:49:48.000Z","dependencies_parsed_at":"2022-08-24T09:00:51.715Z","dependency_job_id":null,"html_url":"https://github.com/siddhi-io/siddhi-execution-tensorflow","commit_stats":null,"previous_names":["wso2-extensions/siddhi-execution-tensorflow"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/siddhi-io/siddhi-execution-tensorflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddhi-io%2Fsiddhi-execution-tensorflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddhi-io%2Fsiddhi-execution-tensorflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddhi-io%2Fsiddhi-execution-tensorflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddhi-io%2Fsiddhi-execution-tensorflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siddhi-io","download_url":"https://codeload.github.com/siddhi-io/siddhi-execution-tensorflow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddhi-io%2Fsiddhi-execution-tensorflow/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259462558,"owners_count":22861512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","deep-neural-network","execution","extension","machine-learning","ml","neural-network","siddhi","tensorflow"],"created_at":"2024-11-08T23:34:17.804Z","updated_at":"2025-06-12T12:08:31.790Z","avatar_url":"https://github.com/siddhi-io.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Siddhi Execution TensorFlow\n======================================\n\n  [![Jenkins Build Status](https://wso2.org/jenkins/job/siddhi/job/siddhi-execution-tensorflow/badge/icon)](https://wso2.org/jenkins/job/siddhi/job/siddhi-execution-tensorflow/)\n  [![GitHub Release](https://img.shields.io/github/release/siddhi-io/siddhi-execution-tensorflow.svg)](https://github.com/siddhi-io/siddhi-execution-tensorflow/releases)\n  [![GitHub Release Date](https://img.shields.io/github/release-date/siddhi-io/siddhi-execution-tensorflow.svg)](https://github.com/siddhi-io/siddhi-execution-tensorflow/releases)\n  [![GitHub Open Issues](https://img.shields.io/github/issues-raw/siddhi-io/siddhi-execution-tensorflow.svg)](https://github.com/siddhi-io/siddhi-execution-tensorflow/issues)\n  [![GitHub Last Commit](https://img.shields.io/github/last-commit/siddhi-io/siddhi-execution-tensorflow.svg)](https://github.com/siddhi-io/siddhi-execution-tensorflow/commits/master)\n  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nThe **siddhi-execution-tensorflow extension** is a \u003ca target=\"_blank\" href=\"https://siddhi.io/\"\u003eSiddhi\u003c/a\u003e extension that provides support for running pre-built TensorFlow models. \n\nFor information on \u003ca target=\"_blank\" href=\"https://siddhi.io/\"\u003eSiddhi\u003c/a\u003e and it's features refer \u003ca target=\"_blank\" href=\"https://siddhi.io/redirect/docs.html\"\u003eSiddhi Documentation\u003c/a\u003e. \n\n## Download\n\n* Versions 2.x and above with group id `io.siddhi.extension.*` from \u003ca target=\"_blank\" href=\"https://mvnrepository.com/artifact/io.siddhi.extension.execution.tensorflow/siddhi-execution-tensorflow/\"\u003ehere\u003c/a\u003e.\n* Versions 1.x and lower with group id `org.wso2.extension.siddhi.*` from \u003ca target=\"_blank\" href=\"https://mvnrepository.com/artifact/org.wso2.extension.siddhi.execution.tensorflow/siddhi-execution-tensorflow\"\u003ehere\u003c/a\u003e.\n\n## Latest API Docs \n\nLatest API Docs is \u003ca target=\"_blank\" href=\"https://siddhi-io.github.io/siddhi-execution-tensorflow/api/2.0.2\"\u003e2.0.2\u003c/a\u003e.\n\n## Features\n\n* \u003ca target=\"_blank\" href=\"https://siddhi-io.github.io/siddhi-execution-tensorflow/api/2.0.2/#predict-stream-processor\"\u003epredict\u003c/a\u003e *(\u003ca target=\"_blank\" href=\"http://siddhi.io/en/v5.1/docs/query-guide/#stream-processor\"\u003eStream Processor\u003c/a\u003e)*\u003cbr\u003e \u003cdiv style=\"padding-left: 1em;\"\u003e\u003cp\u003e\u003cp style=\"word-wrap: break-word;margin: 0;\"\u003ePerforms inferences (prediction) from an already built TensorFlow machine learning model. The types of models are unlimited (including image classifiers, deep learning models) as long as they satisfy the following conditions.\u003cbr\u003e1. They are saved with the tag 'serve' in SavedModel format for more info see [here](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/README.md).\u003cbr\u003e2. Model is initially trained and ready for inferences\u003cbr\u003e3. Inference logic is written and saved in the model\u003cbr\u003e4. signature_def is properly included in the metaGraphDef (a protocol buffer file which has information about the graph) and the key for prediction signature def is 'serving-default'\u003cbr\u003e\u003cbr\u003eAlso the prerequisites for inference are as follows.\u003cbr\u003e1. User knows the names of the input and output nodes\u003cbr\u003e2. Has a preprocessed data set of Java primitive types or their multidimensional arrays\u003cbr\u003e\u003cbr\u003eSince each input is directly used to create a Tensor they should be of compatible shape and data type with the model.\u003cbr\u003eThe information related to input and output nodes can be retrieved from saved model signature def.signature_def can be read by using the saved_model_cli commands found at [https://www.tensorflow.org/programmers_guide/saved_model](https://www.tensorflow.org/programmers_guide/saved_model).\u003cbr\u003esignature_def can be read in Python as follows\u003cbr\u003e\u003c/p\u003e\u003cpre\u003e\nwith tf.Session() as sess:\n  md = tf.saved_model.loader.load(sess, ['serve'], export_dir)\n  sig = md.signature_def[tf.saved_model.signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY]\n  print(sig)\n\u003c/pre\u003e\u003cp style=\"word-wrap: break-word;margin: 0;\"\u003e\u003cbr\u003eOr you can read signature def from Java as follows,\u003cbr\u003e\u003c/p\u003e\u003cpre\u003e\nfinal String DEFAULT_SERVING_SIGNATURE_DEF_KEY = \"serving_default\";\nfinal SignatureDef sig =\n      MetaGraphDef.parseFrom(model.metaGraphDef())\n          .getSignatureDefOrThrow(DEFAULT_SERVING_SIGNATURE_DEF_KEY);\n\u003c/pre\u003e\u003cp style=\"word-wrap: break-word;margin: 0;\"\u003e\u003cbr\u003eYou will have to import the following in Java.\u003cbr\u003e\u003ccode\u003eimport org.tensorflow.framework.MetaGraphDef;\u003c/code\u003e\u003cbr\u003e\u003ccode\u003eimport org.tensorflow.framework.SignatureDef;\u003c/code\u003e\u003c/p\u003e\u003c/p\u003e\u003c/div\u003e\n\n## Dependencies \n\nThere are no other dependencies needed for this extension. \n\n## Installation\n\nFor installing this extension on various siddhi execution environments refer Siddhi documentation section on \u003ca target=\"_blank\" href=\"https://siddhi.io/redirect/add-extensions.html\"\u003eadding extensions\u003c/a\u003e.\n\n## Support and Contribution\n\n* We encourage users to ask questions and get support via \u003ca target=\"_blank\" href=\"https://stackoverflow.com/questions/tagged/siddhi\"\u003eStackOverflow\u003c/a\u003e, make sure to add the `siddhi` tag to the issue for better response.\n\n* If you find any issues related to the extension please report them on \u003ca target=\"_blank\" href=\"https://github.com/siddhi-io/siddhi-execution-tensorflow/issues\"\u003ethe issue tracker\u003c/a\u003e.\n\n* For production support and other contribution related information refer \u003ca target=\"_blank\" href=\"https://siddhi.io/community/\"\u003eSiddhi Community\u003c/a\u003e documentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddhi-io%2Fsiddhi-execution-tensorflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiddhi-io%2Fsiddhi-execution-tensorflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddhi-io%2Fsiddhi-execution-tensorflow/lists"}