askual/facify

FaceApp PHP API wrapper

dev-master 2018-09-05 04:14 UTC

This package is not auto-updated.

Last update: 2024-06-21 07:23:59 UTC


README

Facify

Transform your face using Artificial Intelligence with PHP FaceApp API
FaceApp is an Android and iOS application.
This library is an unofficial wrapper to their AI system.

Requirements

  • PHP >= 7.0
  • cURL/PHP

Basic usage

	composer require askual/facify

Methods

$FaceApp = new Facify('PHOTO_PATH');

getPhotoCode

Get the 'photo unique id' that has Been uploaded to faceapp servers

$photoCode = $FaceApp->getPhotoCode();

getFilters

Get all filters are available to apply the photo

$photoCode = $FaceApp->getFilters(); //returns an array of filters

/*filters : 
	-no-filter
	-smile
	-smile_2
	-hot
	-old
	-young
	-hollywood
	-fun_glasses
	-hitman
	-mustache_free
	-pan
	-heisenberg
	-female
	-female_2
	-male
	-no-filter
	-impression
	-goatee
	-mustache
	-hipster
	-lion
	-bangs
	-glasses
	-wave
	-makeup
*/

applyFilter

Get the code of photo has Been uploaded to faceapp servers

$FaceApp->applyFilter(PHOTO_CODE , SELECTED_FILTER , CROP_FACE_OR_NOT);

//example :
//PHOTO_CODE(string) : $photoCode
//SELECTED_FILTER(string) : 'old'
//CROP_FACE_OR_NOT(bool) : true or false

savePhoto

Save the final filtered photo

$FaceApp->savePhoto('NEW_PHOTO_PATH.jpg');

Proxy Mode

As you may know this service has some limits for requesting so I created a "Proxy Mode" for it
Proxy servers has been added to faceapp.php line 44
All of them works well but i dont guarantee them to work for a long time
If you have any proxy server you can put it in the list
And you can turn the proxy server on with this code

$FaceApp = new FaceApp('PHOTO_PATH', true );

Take a look at "ProxyMode.php"

License

Facify is licensed under the MIT License - see the LICENSE file for details

Askual.com