包括画卡通画,找出2张图片的相似度,电脑做梦的图片生成,利用GTP-2的文本续写。

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using DeepAI;
namespace WpfApp7
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent(); } void TestCartoon() { // Ensure your DeepAI.Client NuGet package is up to date: https://www.nuget.org/packages/DeepAI.Client
// Example posting a image URL: // using DeepAI; // Add this line to the top of your file //DeepAI_API api = new DeepAI_API(apiKey: "quickstart-QUdJIGlzIGNvbWluZy4uLi4K"); //StandardApiResponse resp = api.callStandardApi("toonify", new
//{
// image = "YOUR_IMAGE_URL",
//});
//Console.Write(api.objectAsJsonString(resp)); // Example posting a local image file: // using DeepAI; // Add this line to the top of your file DeepAI_API api = new DeepAI_API(apiKey: "quickstart-QUdJIGlzIGNvbWluZy4uLi4K"); StandardApiResponse resp = api.callStandardApi("toonify", new
{
image = File.OpenRead(@"C:\Users\gwang\Pictures\1469162215-how-to-read-faces.jpg"),
}); Console.Write(api.objectAsJsonString(resp)); } void TestSearchSimil2Image() { //DeepAI_API api = new DeepAI_API(apiKey: "quickstart-QUdJIGlzIGNvbWluZy4uLi4K"); //StandardApiResponse resp = api.callStandardApi("image-similarity", new
//{
// image1 = "YOUR_IMAGE_URL",
// image2 = "YOUR_IMAGE_URL",
//});
//Console.Write(api.objectAsJsonString(resp)); // Example posting a local image file: DeepAI_API api = new DeepAI_API(apiKey: "quickstart-QUdJIGlzIGNvbWluZy4uLi4K"); StandardApiResponse resp = api.callStandardApi("image-similarity", new
{
image1 = File.OpenRead("C:\\path\\to\\your\\file.jpg"),
image2 = File.OpenRead("C:\\path\\to\\your\\file.jpg"),
});
Console.Write(api.objectAsJsonString(resp)); } void TestDeepDream() { // Ensure your DeepAI.Client NuGet package is up to date: https://www.nuget.org/packages/DeepAI.Client
// Example posting a image URL: //using DeepAI; // Add this line to the top of your file //DeepAI_API api = new DeepAI_API(apiKey: "quickstart-QUdJIGlzIGNvbWluZy4uLi4K"); //StandardApiResponse resp = api.callStandardApi("deepdream", new
//{
// image = "YOUR_IMAGE_URL",
//});
//Console.Write(api.objectAsJsonString(resp)); // Example posting a local image file: // using DeepAI; // Add this line to the top of your file DeepAI_API api = new DeepAI_API(apiKey: "quickstart-QUdJIGlzIGNvbWluZy4uLi4K"); StandardApiResponse resp = api.callStandardApi("deepdream", new
{
image = File.OpenRead(@"C:\Users\gwang\Pictures\1469162215-how-to-read-faces.jpg"),
});
Console.Write(api.objectAsJsonString(resp)); } void TestTextGeneration() { //https://deepai.org/machine-learning-model/text-generator
// Text Generation Csharp Examples
// Ensure your DeepAI.Client NuGet package is up to date: https://www.nuget.org/packages/DeepAI.Client
// Example posting a text URL: // using DeepAI; // Add this line to the top of your file //DeepAI_API api = new DeepAI_API(apiKey: "quickstart-QUdJIGlzIGNvbWluZy4uLi4K"); //StandardApiResponse resp = api.callStandardApi("text-generator", new
//{
// text = "YOUR_TEXT_URL",
//});
//Console.Write(api.objectAsJsonString(resp)); // Example posting a local text file: //using DeepAI; // Add this line to the top of your file //DeepAI_API api = new DeepAI_API(apiKey: "quickstart-QUdJIGlzIGNvbWluZy4uLi4K"); //StandardApiResponse resp = api.callStandardApi("text-generator", new
//{
// text = File.OpenRead("C:\\path\\to\\your\\file.txt"),
//});
//Console.Write(api.objectAsJsonString(resp)); //// Example directly sending a text string: //using DeepAI; // Add this line to the top of your file DeepAI_API api = new DeepAI_API(apiKey: "quickstart-QUdJIGlzIGNvbWluZy4uLi4K"); StandardApiResponse resp = api.callStandardApi("text-generator", new
{
text = "Three days into the Tokyo 2020 Games, 20 sports will be contested today",
});
Console.Write(api.objectAsJsonString(resp)); } private void Button_Click(object sender, RoutedEventArgs e)
{
TestTextGeneration();
// TestDeepDream ();
} } }

  

c# 调用DeepAI的更多相关文章

  1. 黑马毕向东Java基础知识总结

    Java基础知识总结(超级经典) 转自:百度文库 黑马毕向东JAVA基础总结笔记    侵删! 写代码: 1,明确需求.我要做什么? 2,分析思路.我要怎么做?1,2,3. 3,确定步骤.每一个思路部 ...

  2. 《果壳中的C# C# 5.0 权威指南》 - 学习笔记

    <果壳中的C# C# 5.0 权威指南> ========== ========== ==========[作者] (美) Joseph Albahari (美) Ben Albahari ...

  3. JS调用Android、Ios原生控件

    在上一篇博客中已经和大家聊了,关于JS与Android.Ios原生控件之间相互通信的详细代码实现,今天我们一起聊一下JS调用Android.Ios通信的相同点和不同点,以便帮助我们在进行混合式开发时, ...

  4. 【原创分享·支付宝支付】HBuilder打包APP调用支付宝客户端支付

    前言 最近有点空余时间,所以,就研究了一下APP支付.前面很早就搞完APP的微信支付了,但是由于时间上和应用上的情况,支付宝一直没空去研究.然后等我空了的时候,发现支付宝居然升级了支付逻辑,虽然目前还 ...

  5. 操作系统篇-调用门与特权级(CPL、DPL和RPL)

    || 版权声明:本文为博主原创文章,未经博主允许不得转载. 一.前言 在前两篇文章(<操作系统篇-浅谈实模式与保护模式>和<操作系统篇-分段机制与GDT|LDT>)中,我们提到 ...

  6. 架构设计:远程调用服务架构设计及zookeeper技术详解(下篇)

    一.下篇开头的废话 终于开写下篇了,这也是我写远程调用框架的第三篇文章,前两篇都被博客园作为[编辑推荐]的文章,很兴奋哦,嘿嘿~~~~,本人是个很臭美的人,一定得要截图为证: 今天是2014年的第一天 ...

  7. django server之间通过remote user 相互调用

    首先,场景是这样的:存在两个django web应用,并且两个应用存在一定的联系.某些情况下彼此需要获取对方的数据. 但是我们的应用肯经都会有对应的鉴权机制.不会让人家随随便便就访问的对吧.好比上车要 ...

  8. 调用AJAX做登陆和注册

    先建立一个页面来检测一下我们建立的用户名能不能用,看一下有没有已经存在的用户名吗 可以通过ajax提示一下 $("#uid").blur(function(){ //取用户名 va ...

  9. nodejs进阶(2)—函数模块调用

    函数调用 1. 文件内普通函数调用 创建一个js文件命名为2_callFunction.js,其中定义一个函数fun1,向返回对象输出了一段字符串“你好,我是fun1”. //------------ ...

  10. 【初学python】使用python调用monkey测试

    目前公司主要开发安卓平台的APP,平时测试经常需要使用monkey测试,所以尝试了下用python调用monkey,代码如下: import os apk = {'j': 'com.***.test1 ...

随机推荐

  1. Cargo deny安装指路

    本博客所有文章除特别声明外,均采用CC BY-NC-SA 4.0许可协议.转载请注明来自 唯你 简介 cargo deny 是一个 Rust 工具,用于检查项目依赖项的许可证.安全性和其他合规性问题. ...

  2. 数据结构课程设计报告-C 语言整数单链表的表示和实现

    数据结构课程设计报告 专业名称:计算机科学与技术 课程名称:数据结构        实训题目:整数单链表的表示和实现                            实训环境:C 语言实现( D ...

  3. ubuntu卸载php8后在命令行终端上面还是显示8的版本

    使用apt install了php8然后卸载后发现php -v还是8的版本,找来找去,最后发现是需要卸载sudo apt remove php8.0-cli才行 然后使用 sudo apt autor ...

  4. Linux中的用户管理-创建删除修改

    用户管理 一.用户分类 用户分为三类: 1.管理员 root root UID:0 #拥有最高权限 默认系统中就一个 UID即user ID 类似于身份号码,唯一的,不可重复 2.虚拟用户 作用:在运 ...

  5. Gunicorn 部署 Flask-Apscheduler 重复执行问题

    目录 踩坑一:TimeZone offset does not match system offset 踩坑二:Flask-Apscheduler 多进程环境重复运行 踩坑三:集群环境下,Flask- ...

  6. 想学习建个网站?WAMP Server助你在Windows上快速搭建PHP集成环境

    我想只要爬过几天网的同学都会知道PHP吧,异次元的新版本就是基于PHP的WordPress程序制造出来的,还有国内绝大部分论坛都是PHP的哦.据我所知很多同学都想要试着学习一下PHP,无奈要在Wind ...

  7. Five minute introduction to ANTLR 3

    What is ANTLR 3? ANTLR - ANother Tool for Language Recognition - is a tool that is used in the const ...

  8. vue中去掉地址栏中的#

    mode设置成history就可以了

  9. Go Vue3 CMS管理后台(前后端分离模式)

    本后台使用前后端分离模式开发,前端UI为Vue3+Ant Design Vue,后端Api为Go+Gin,解耦前后端逻辑,使开发更专注 技术栈 前端:Vue3,Ant Design Vue,Axios ...

  10. Newstar CTF 2023 week2 pwn

    1.ret2libc 发现存在pop rdi 观察main函数,可以利用puts函数泄露libc from pwn import * from LibcSearcher import * contex ...