PHPackages                             bubnov/tenserflow-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. bubnov/tenserflow-bundle

ActiveSymfony-bundle[Image &amp; Media](/categories/media)

bubnov/tenserflow-bundle
========================

Integrates tenserflow recognizer into your Symfony2/Symfony3 application

3.0.6(9y ago)348MITPHPPHP &gt;=5.5

Since Aug 8Pushed 9y ago1 watchersCompare

[ Source](https://github.com/bubnov-mikhail/tenserflow-bundle)[ Packagist](https://packagist.org/packages/bubnov/tenserflow-bundle)[ Docs](https://github.com/bubnov-mikhail/tenserflow-bundle)[ RSS](/packages/bubnov-tenserflow-bundle/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)Dependencies (1)Versions (17)Used By (0)

BubnovTensorFlowBundle
======================

[](#bubnovtensorflowbundle)

This bundle provides service and command to recognize image. Both will return RecognizeResult object.

### Requirements

[](#requirements)

- PHP 5.4 or higher
- symfony &gt; 2.3

### Installation

[](#installation)

To install bubnov/tenserflow-bundle with Composer just add the following to your 'composer.json' file:

```
{
    ...
    "scripts": {
        "post-install-cmd": [ "TensorFlowBinaryInstaller::install" ],
        "post-update-cmd":  [ "TensorFlowBinaryInstaller::update" ]
    },
    ...
}

```

The next thing you should do is to install the bundle by executing the following command:

```
```sh
composer require bubnov/tenserflow-bundle: ~3.0
```

```

Finally, add the bundle to the registerBundles function of the AppKernel class in the 'app/AppKernel.php' file:

```
public function registerBundles()
{
    $bundles = array(
        ...
        new Bubnov\TensorFlowBundle\BubnovTensorFlowBundle(),
        ...
    );

```

### Usage

[](#usage)

When you want to use service from the controller you can simply call:

```
/* @var $result \Bubnov\TensorFlowBundle\Util\RecognizerResult */
$result = $this->get('tenserflow.recognizer')->recognize('some/path/to/image'); //Returns RecognizerResult object

/* @var $label \Bubnov\TensorFlowBundle\Util\Label */
$label = $result->getTopLabel();           // Returns Label with highest score
$label->getName();                         // Returns label`s name
$label->getScore();                        // Returns label`s score

$labels = $result->getLabels();            // Returns array of Label in order of score.
$labels = $result->getLabelsScored(0.8);   // Returns array of Label in order of score with score more or equal 0.8

/**
 * Find if there are any labels in the Dictionary
 */
$dict = new \Bubnov\TensorFlowBundle\Util\Dictionary(['apple', 'fruit']);
$dict->add('blueberry');                         // Add string to the dictionary

$scoreThreshold = 0.7;                           // Optional threshold
$dict->match($result, $scoreThreshold);          // Return true or false

```

Where is also the command for testing images "bubnov\_tensorflow:recognize". Usage:

```
bubnov_tensorflow:recognize /absolute/path/to/image.ext

```

Command will return multiline string with labels and scores

To create dictionary with common labels to the same images in some directory, you can call:

```
find /path/to/dir/with/images -type f | parallel ./bin/console bubnov_tensorflow:fill_dict {} --tmpdict /path/to/dict.tmp

```

This command using GNU parallel. Optional --tmpdict may be omitted - temporary dict file will be saved to /tmp/tensorFlowBundle.dict.tmp After complete, call:

```
bin/console bubnov_tensorflow:combine_dict --tmpdict /path/to/dict.tmp --dict /path/to/complete.dict

```

This command will create dictionary with labels and the number of their repetitions in the dict.tmp file. Now you may choose, which labels to include in Dictionary. Optional --dict may be omitted - dict file will be saved to /tmp/tensorFlowBundle.dict Optional --tmpdict may be omitted - temporary dict file will be read from /tmp/tensorFlowBundle.dict.tmp

### Configuration

[](#configuration)

This bundle will work with standalone configuration, but you may redefine some paths. It is optional and not necessary

```
bubnov_tensor_flow:
    recognizer:
        binary: 'some/path/to/label_image binary'
        graph: 'some/path/to/graph.pb'
        labels: 'some/path/to/labels.txt'
```

### Credits

[](#credits)

This bundle is a wrapper around tenderflow`s label\_image binary with tiny updates:  by The TensorFlow Authors

Bundle code is written by Mikhail Bubnov

### License

[](#license)

This bundle is under the MIT license.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~11 days

Recently: every ~24 days

Total

16

Last Release

3445d ago

Major Versions

v0.1.4 → v1.0.02016-08-09

v1.0.1 → 3.0.02016-09-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/cfc35f6ef7f8c1025f89bed8181c928aac39c2fb9884009f8b9dc44fc50c7020?d=identicon)[bubnov](/maintainers/bubnov)

---

Top Contributors

[![bubnov-mikhail](https://avatars.githubusercontent.com/u/5926697?v=4)](https://github.com/bubnov-mikhail "bubnov-mikhail (4 commits)")

---

Tags

image-recognitionsymfony-bundlesymfony-servicebundleimagetenserflowrecognizer

### Embed Badge

![Health badge](/badges/bubnov-tenserflow-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/bubnov-tenserflow-bundle/health.svg)](https://phpackages.com/packages/bubnov-tenserflow-bundle)
```

###  Alternatives

[liip/imagine-bundle

This bundle provides an image manipulation abstraction toolkit for Symfony-based projects.

1.7k39.4M239](/packages/liip-imagine-bundle)[mediamonks/sonata-media-bundle

A powerful, flexible and easy to use alternative for the existing Sonata Media Bundle

109.8k](/packages/mediamonks-sonata-media-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
