C# OpenCvSharp DNN 深度神经网络下的风格迁移模型

目录

介绍

效果

项目

代码

下载


C# OpenCvSharp DNN 深度神经网络下的风格迁移模型

介绍

深度神经网络下的风格迁移模型,适用于OpenCv、EmguCv。

斯坦福大学李飞飞团队的风格迁移模型是一种基于深度学习的图像处理技术,可以将一张图像的风格转移到另一张图像上。该模型最初由Gatys等人提出,后来被李飞飞团队进一步优化和改进。该模型在图像处理领域具有广泛的应用,例如艺术风格转换、视频风格迁移等。

github地址:https://github.com/jcjohnson/fast-neural-style

效果

eccv16/composition_vii.t7

eccv16/la_muse.t7

eccv16/starry_night.t7

eccv16/the_wave.t7

instance_norm/candy.t7

instance_norm/feathers.t7

instance_norm/la_muse.t7

instance_norm/mosaic.t7

instance_norm/the_scream.t7

instance_norm/udnie.t7

项目

代码

保存图像

if (pictureBox2.Image == null)

{

return;

}

Bitmap output = new Bitmap(pictureBox2.Image);

var sdf = new SaveFileDialog();

sdf.Title = "保存";

sdf.Filter = "Images (*.bmp)|*.bmp|Images (*.emf)|*.emf|Images (*.exif)|*.exif|Images (*.gif)|*.gif|Images (*.ico)|*.ico|Images (*.jpg)|*.jpg|Images (*.png)|*.png|Images (*.tiff)|*.tiff|Images (*.wmf)|*.wmf";

if (sdf.ShowDialog() == DialogResult.OK)

{

switch (sdf.FilterIndex)

{

case 1:

{

output.Save(sdf.FileName, ImageFormat.Bmp);

break;

}

case 2:

{

output.Save(sdf.FileName, ImageFormat.Emf);

break;

}

case 3:

{

output.Save(sdf.FileName, ImageFormat.Exif);

break;

}

case 4:

{

output.Save(sdf.FileName, ImageFormat.Gif);

break;

}

case 5:

{

output.Save(sdf.FileName, ImageFormat.Icon);

break;

}

case 6:

{

output.Save(sdf.FileName, ImageFormat.Jpeg);

break;

}

case 7:

{

output.Save(sdf.FileName, ImageFormat.Png);

break;

}

case 8:

{

output.Save(sdf.FileName, ImageFormat.Tiff);

break;

}

case 9:

{

output.Save(sdf.FileName, ImageFormat.Wmf);

break;

}

}

MessageBox.Show("保存成功,位置:" + sdf.FileName);

}

if (pictureBox2.Image == null)
{
    return;
}
Bitmap output = new Bitmap(pictureBox2.Image);
var sdf = new SaveFileDialog();
sdf.Title = "保存";
sdf.Filter = "Images (*.bmp)|*.bmp|Images (*.emf)|*.emf|Images (*.exif)|*.exif|Images (*.gif)|*.gif|Images (*.ico)|*.ico|Images (*.jpg)|*.jpg|Images (*.png)|*.png|Images (*.tiff)|*.tiff|Images (*.wmf)|*.wmf";
if (sdf.ShowDialog() == DialogResult.OK)
{
    switch (sdf.FilterIndex)
    {
        case 1:
            {
                output.Save(sdf.FileName, ImageFormat.Bmp);
                break;
            }
        case 2:
            {
                output.Save(sdf.FileName, ImageFormat.Emf);
                break;
            }
        case 3:
            {
                output.Save(sdf.FileName, ImageFormat.Exif);
                break;
            }
        case 4:
            {
                output.Save(sdf.FileName, ImageFormat.Gif);
                break;
            }
        case 5:
            {
                output.Save(sdf.FileName, ImageFormat.Icon);
                break;
            }
        case 6:
            {
                output.Save(sdf.FileName, ImageFormat.Jpeg);
                break;
            }
        case 7:
            {
                output.Save(sdf.FileName, ImageFormat.Png);
                break;
            }
        case 8:
            {
                output.Save(sdf.FileName, ImageFormat.Tiff);
                break;
            }
        case 9:
            {
                output.Save(sdf.FileName, ImageFormat.Wmf);
                break;
            }
    }
    MessageBox.Show("保存成功,位置:" + sdf.FileName);
}

下载

源码下载

可运行程序exe包下载

相关推荐
代码骑士18 分钟前
【一起学NLP】Chapter3-使用神经网络解决问题
python·神经网络·自然语言处理
可惜已不在32 分钟前
AI 搜索引擎工具集合
人工智能·ai
Landy_Jay36 分钟前
深度学习:基于MindSpore实现CycleGAN壁画修复
人工智能·深度学习
Funny_AI_LAB1 小时前
MetaAI最新开源Llama3.2亮点及使用指南
算法·计算机视觉·语言模型·llama·facebook
weixin_464078071 小时前
C#串口温度读取
开发语言·c#
Langchain1 小时前
不可错过!CMU最新《生成式人工智能大模型》课程:从文本、图像到多模态大模型
人工智能·自然语言处理·langchain·大模型·llm·大语言模型·多模态大模型
zmjia1111 小时前
全流程Python编程、机器学习与深度学习实践技术应用
python·深度学习·机器学习
龙的爹23331 小时前
论文翻译 | Generated Knowledge Prompting for Commonsense Reasoning
人工智能·gpt·机器学习·语言模型·自然语言处理·nlp·prompt
龙的爹23331 小时前
论文翻译 | Model-tuning Via Prompts Makes NLP Models Adversarially Robust
人工智能·gpt·语言模型·自然语言处理·nlp·prompt
方世恩2 小时前
【进阶OpenCV】 (5)--指纹验证
人工智能·opencv·目标检测·计算机视觉