请知悉:本文最近一次更新为 4年 前,文中内容可能已经过时。

Waifu2x,是一个使用卷积神经网络对动漫风格的图片进行放大操作(支持照片)的程序。

有没有一个API可以直接使用Waifu2x对图片进行放大呢?经过查找,在deepai.org找到了。

API的说明示例地址:https://deepai.org/machine-learning-model/waifu2x

注册后,凭自己的api-key请求接口,发送图片即可。

PHP版本调用方法示例代码:

function zoomPic($loc) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true);
$data = array('image' => new CURLFile($loc));
curl_setopt($ch, CURLOPT_URL, "https://api.deepai.org/api/waifu2x");
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$host = array("api-key: 你的API-KEY");
curl_setopt($ch, CURLOPT_HTTPHEADER,$host);
$r = curl_exec($ch);
if (curl_errno($ch)) {
echo 'error: ' . curl_error($ch)."rn";
} else {
$r = json_decode($r, true);
echo $r['output_url'];
}
}

相关链接:
https://deepai.org/machine-learning-model/waifu2x
https://waifu2x.udp.jp/
https://github.com/nagadomi/waifu2x


如您从本文得到了有价值的信息或帮助,请考虑扫描文末二维码捐赠和鼓励。

尊重他人劳动成果。转载请务必附上原文链接,我将感激不尽。


与《Waifu2x API 图片放大接口-PHP版本》相关的博文:


2
留言

avatar
😀
😀😁😂😅😭🤭😋😘🤔😰😱🤪💪👍👎🤝🌹👌
owbest
owbest
【🚶访客】

关于此API接口,能否设置noise和scale参数?