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包下载

相关推荐
试剂界的爱马仕12 分钟前
TCA 循环中间体如何改写肝损伤命运【AbMole】
大数据·人工智能·科技·机器学习·ai写作
研一计算机小白一枚19 分钟前
VRFF: Video Registration and FusionFramework 论文详解
人工智能·深度学习·计算机视觉
Leo.yuan31 分钟前
数据湖是什么?数据湖和数据仓库的区别是什么?
大数据·运维·数据仓库·人工智能·信息可视化
仙人掌_lz1 小时前
如何打造一款金融推理工具Financial Reasoning Workflow:WebUI+Ollama+Fin-R1+MCP/RAG
人工智能·搜索引擎·ai·金融·llm·rag·mcp
MILI元宇宙1 小时前
纳米AI搜索与百度AI搜、豆包的核心差异解析
人工智能·百度
SpikeKing1 小时前
LLM - LlamaFactory 的大模型推理 踩坑记录
人工智能·llm·llamafactory
marteker1 小时前
年度峰会上,抖音依靠人工智能和搜索功能吸引广告主
人工智能·搜索引擎
飞哥数智坊1 小时前
AI编程实战:生成结果不合心意,1个简单思路帮你破解
人工智能·cursor
Takina~1 小时前
python打卡day48
pytorch·python·深度学习
华清远见成都中心1 小时前
大语言模型(LLM)中的KV缓存压缩与动态稀疏注意力机制设计
人工智能·缓存·语言模型