先看DEMO
https://demos.algorithmia.com/colorize-photos/
了解ColorfulImageColorization
https://algorithmia.com/algorithms/deeplearning/ColorfulImageColorization
开发者中心
https://algorithmia.com/developers/clients/php/
申请账号
https://algorithmia.com/signup
Algorithmia
E:deeplearningColorfulImageColorization>composer require algorithmia/algorithmia
demo.php示例
<?php require_once 'vendor/autoload.php'; $input = json_decode('{ "image": "http://www.ccsph.com/uploadfiles/images/20140903/0903014741704335.jpg", "location": "data://coffeehan/test1219/55.png" }'); $client = Algorithmia::client("simLka50Eld+o1aKJXX6ZprZOWO1"); $algo = $client->algo("deeplearning/ColorfulImageColorization/1.1.13"); print_r($algo->pipe($input)->result); $mydir = $client->dir("data://coffeehan/test1219"); $myfile = $mydir->file("55.png"); $temp_file = $myfile->getFile(); @copy($temp_file, './55.png'); @unlink($temp_file); ?>
实际效果