Download the PHP package funcai/funcai-php without Composer

On this page you can find all versions of the php package funcai/funcai-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package funcai-php

🌟 FuncAI PHP 🌟

FuncAI is a high performance, state of the art machine learning library for PHP.
It has no dependencies and can run everywhere PHP can run.

If you can spare 2 minutes, please give me some feedback


🖼️ Image stylization 🖼️

Apply the style of one image to another image.

Example

Shows mona lisa and a comic character which combined result in a third image of mona lisa in the style of the comic character

Use it for:

Credits


🏷️ Image classification 🏷️

Find out what's in an image. Returns the top 5 classes out of a list of 21.825 classes.

Example

An image of a butterfly and 5 matching labels next to it

Use it for:

Credits


Future applications

If you have a usecase that's not listed above, please create an issue and explain what you would like to do.

Features

Installation

1. Install the package via composer:

composer require funcai/funcai-php

2. Download the tensorflow library:

php vendor/funcai/funcai-php/install.php

This downloads tensorflow to ./tensorflow.

3. Download a model

php vendor/funcai/funcai-php/install-stylization.php

This downloads the stylization model to ./models

4. Configure the models folder

You will need to move the models folder to a permanent location. For example, move it to /var/www/models on your server. In that case make sure to set the base path accordingly:

\FuncAI\Config::setModelBasePath('/var/www/models');

You can also move the folder directly into your project and check them into git, but the folder might get quite big (100 Mb up to multiple Gb).

Usage

After you've completed the installation steps you can run your first prediction:

\FuncAI\Config::setLibPath('./tensorflow/'); // This should point to the path from step 2 
\FuncAI\Config::setModelBasePath('./models'); // This should point to the path from step 4
$model = new \FuncAI\Models\Stylization();
$model->predict([
__DIR__ . '/sample_data/prince-akachi.jpg',
__DIR__ . '/sample_data/style.jpg',
]);

This will output the stylized image to ./out.jpg.

Requirements

About machine learning

todo

How to run the docker file

Architecture

Todo

Development

Docker (optional, but recommended)

Install Docker.

Download the efficientnet model

To be able to run the example file you need to run the following docker command which will download the efficientnet model and save it in the correct file format:

docker run -it --rm -v $PWD:/code -w /code tensorflow/tensorflow:2.3.0 python scripts/generate/efficientnet.py

Alternatively, if you already have python3 installed you can directly run:

pip3 install tensorflow
python3 scripts/generate/efficientnet.py

Run the provided Docker container (optional)

To start the provided Docker container which provides you with a working php7.4 installation run:

docker-compose up -d

Afterwards run:

docker-compose exec app bash

to get a Terminal inside of the docker container.

Alternatively you can setup a PHP 7.4 environment locally and use that.

Better phpstorm support (optional)

Go to your settings and open "Languages & Frameworks -> PHP -> PHP Runtime -> Others". Make sure "FFI" is checked.


All versions of funcai-php with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4.0|^8.0
ext-gd Version *
ext-curl Version *
ext-phar Version *
ext-ffi Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package funcai/funcai-php contains the following files

Loading the files please wait ....