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

相关推荐
饕餮怪程序猿6 分钟前
Datawhale AI 夏令营:用户洞察挑战赛 Notebook(1)
人工智能
玩转AGI8 分钟前
Dify篇-基于ChatFlow搭建文章理解助手
人工智能·程序员·llm
Blue桃之夭夭8 分钟前
基于OpenCV的实时人脸检测系统实现指南 ——Python+Haar级联分类器从环境搭建到完整部署
人工智能·python·opencv
qyresearch_11 分钟前
全球机械工业设计服务市场:技术驱动下的创新与增长
大数据·人工智能
禺垣14 分钟前
Transformer模型原理概述
深度学习
LLM大模型15 分钟前
DeepSeek篇-Deepseek-R1+Dify打造本地RAG知识库
人工智能·llm·deepseek
北京地铁1号线15 分钟前
Zero-Shot(零样本学习),One-Shot(单样本学习),Few-Shot(少样本学习)概述
人工智能·算法·大模型
杀生丸学AI20 分钟前
【三维生成】FlashDreamer:基于扩散模型的单目图像到3D场景
人工智能·3d·大模型·aigc·蒸馏与迁移学习·扩散模型与生成模型
柠檬味拥抱21 分钟前
金属材料表面六种缺陷类型数据集 | 适用于YOLO等视觉检测模型(1800张图片已划分、已标注)
人工智能
Baihai_IDP34 分钟前
AI 系统架构的演进:LLM → RAG → AI Workflow → AI Agent
人工智能·llm·aigc