All Projects ā†’ sjkaliski ā†’ infer

sjkaliski / infer

Licence: MIT license
šŸ”® Use TensorFlow models in Go to evaluate Images (and more soon!)

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to infer

Bevel
Ordinal regression in Python
Stars: āœ­ 41 (-36.92%)
Mutual labels:  inference, prediction
forestError
A Unified Framework for Random Forest Prediction Error Estimation
Stars: āœ­ 23 (-64.62%)
Mutual labels:  inference, prediction
GA-BP
åŸŗäŗŽé—ä¼ ē®—ę³•ēš„BPē½‘ē»œč®¾č®”ļ¼Œåŗ”ē”Ø背ę™Æäøŗäŗ¤é€šęµé‡ēš„é¢„ęµ‹
Stars: āœ­ 102 (+56.92%)
Mutual labels:  prediction
object-size-detector-python
Monitor mechanical bolts as they move down a conveyor belt. When a bolt of an irregular size is detected, this solution emits an alert.
Stars: āœ­ 26 (-60%)
Mutual labels:  inference
gospn
A free, open-source inference and learning library for Sum-Product Networks (SPN)
Stars: āœ­ 24 (-63.08%)
Mutual labels:  inference
Sales-Prediction
In depth analysis and forecasting of product sales based on the items, stores, transaction and other dependent variables like holidays and oil prices.
Stars: āœ­ 56 (-13.85%)
Mutual labels:  prediction
behaiv-java
User Behavior Prediction for everyone
Stars: āœ­ 12 (-81.54%)
Mutual labels:  prediction
kriptomist
Fundamental cryptocurrency analysis
Stars: āœ­ 29 (-55.38%)
Mutual labels:  prediction
go-topics
Latent Dirichlet Allocation
Stars: āœ­ 23 (-64.62%)
Mutual labels:  inference
mediapipe plus
The purpose of this project is to apply mediapipe to more AI chips.
Stars: āœ­ 38 (-41.54%)
Mutual labels:  inference
Loan-Prediction-Dataset
No description or website provided.
Stars: āœ­ 21 (-67.69%)
Mutual labels:  prediction
IGoR
IGoR is a C++ software designed to infer V(D)J recombination related processes from sequencing data. Find full documentation at:
Stars: āœ­ 42 (-35.38%)
Mutual labels:  inference
PyDREAM
Python Implementation of Decay Replay Mining (DREAM)
Stars: āœ­ 22 (-66.15%)
Mutual labels:  prediction
Wharton Stat 422 722
The official class webpage for Statistics 422/722 taught at Wharton in the Spring of 2017
Stars: āœ­ 14 (-78.46%)
Mutual labels:  prediction
Molecules Dataset Collection
Collection of data sets of molecules for a validation of properties inference
Stars: āœ­ 69 (+6.15%)
Mutual labels:  inference
reinforcement learning course materials
Lecture notes, tutorial tasks including solutions as well as online videos for the reinforcement learning course hosted by Paderborn University
Stars: āœ­ 765 (+1076.92%)
Mutual labels:  prediction
ims
šŸ“š Introduction to Modern Statistics - A college-level open-source textbook with a modern approach highlighting multivariable relationships and simulation-based inference.
Stars: āœ­ 509 (+683.08%)
Mutual labels:  inference
verif
Software for verifying weather forecasts
Stars: āœ­ 70 (+7.69%)
Mutual labels:  prediction
intruder-detector-python
Build an application that alerts you when someone enters a restricted area. Learn how to use models for multiclass object detection.
Stars: āœ­ 16 (-75.38%)
Mutual labels:  inference
MSDS696-Masters-Final-Project
Earthquake Prediction Challenge with LightGBM and XGBoost
Stars: āœ­ 58 (-10.77%)
Mutual labels:  prediction

infer

Infer is a Go package for running predicitions in TensorFlow models.

Build Status GoDoc Go Report Card

Overview

This package provides abstractions for running inferences in TensorFlow models for common types. At the moment it only has methods for images, however in the future it can certainly support more.

Getting Started

The easiest way to get going is looking at some examples, two have been provided:

  1. Image Recognition API using Inception.
  2. MNIST

Setup

This package requires

Installation instructions can be found here. Additionally, a Dockerfile has been included which can be used to run the examples.

Usage

Overview

To use infer, a TensorFlow Graph is required, as well as a defined Input and Output.

Classes may also be included, a slice of possible values. It's assumed the results of any model execution refer to these classes, in order. (e.g. 0 -> mountain, 1 -> cat, 2 -> apple).

m, _ = infer.New(&infer.Model{
  Graph: graph,
  Classes: classes,
  Input: &infer.Input{
    Key:        "input",
    Dimensions: []int32{100, 100},
  },
  Output: &infer.Output{
    Key: "output",
  },
})

Once a new model is defined, inferences can be executed.

predictions, _ := m.FromImage(file, &infer.ImageOptions{})

Predictions are returned sorted by score (most accurate first). A Prediction looks like

Prediction{
  Class: "mountain",
  Score: 0.97,
}

Graph

An infer.Model requires a tf.Graph. The Graph defines the computations required to determine an output based on a provided input. The Graph can be included in two ways:

  1. Create the Graph using Go in your application.
  2. Load an existing model.

For the latter, an existing model (containing the graph and weights) can be loaded using Go:

model, _ := ioutil.ReadFile("/path/to/model.pb")
graph := tf.NewGraph()
graph.Import(model, "")

For more information on TensorFlow model files, see here.

Input & Output

infer.Input and infer.Output describe TensorFlow layers. In practice this is the layer the input data should be fed to and the layer from which to fetch results.

Each require a Key. This is the unique identifier (name) in the TensorFlow graph for that layer. To see a list of layers and type, the following can be run:

ops := graph.Operations()
for _, o := range ops {
  log.Println(o.Name(), o.Type())
}

If you're not using a pre-trained model, the layers can be named, which can ease in identifying the appropriate layers.

Analyzing Results

In the MNIST example, we can execute a prediction and inspect results as so:

predictions, err := m.FromImage(img, opts)
if err != nil {
  panic(err)
}

// predictions[0].Class -> 8
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].