当前位置:网站首页>基于ModelArts的StyleGAN3生成高清图丨【华为云至简致远】
基于ModelArts的StyleGAN3生成高清图丨【华为云至简致远】
2022-08-08 13:48:00 【InfoQ】
ModelArts简介
第一步,点击链接进入 ACGAN-动漫头像自动生成 的案例页面,并完成基础配置。


第二步,安装依赖


第三步,生成图片
- 使用预训练的AFHQv2模型生成图片
# 使用预训练的AFHQv2模型生成图片
!python gen_images.py --outdir=out_0 --trunc=1 --seeds=2 \
--network=stylegan3-r-afhqv2-512x512.pkl
# 展示效果
display(Image(filename='./out_0/seed0002.png'))

- 使用预训练的FFHQ模型生成图片
# 使用预训练的FFHQ模型生成图片
!python gen_images.py --outdir=out_1 --trunc=1 --seeds=2 \
--network=stylegan3-r-ffhq-1024x1024.pkl
# 展示效果
display(Image(filename='./out_1/seed0002.png'))
- 使用预训练的metfaces模型生成图片
# 使用预训练的metfaces模型生成图片
!python gen_images.py --outdir=out_2 --trunc=1 --seeds=2 \
--network=stylegan3-r-metfaces-1024x1024.pkl
# 展示效果
display(Image(filename='./out_2/seed0002.png'))
第四步,生成插值视频
- AFHQv2模型

# 展示效果
outpath = "lerp.mp4"
mp4 = open(outpath,'rb').read()
data_url = "data:video/mp4;base64," + b64encode(mp4).decode()
HTML("""
<video width=400 controls>
<source src="%s" type="video/mp4">
</video>
""" % data_url)
- FFHQ模型

# 展示效果
outpath = "ffhq.mp4"
mp4 = open(outpath,'rb').read()
data_url = "data:video/mp4;base64," + b64encode(mp4).decode()
HTML("""
<video width=400 controls>
<source src="%s" type="video/mp4">
</video>
""" % data_url)
- metfaces模型

# 展示效果
outpath = "met.mp4"
mp4 = open(outpath,'rb').read()
data_url = "data:video/mp4;base64," + b64encode(mp4).decode()
HTML("""
<video width=400 controls>
<source src="%s" type="video/mp4">
</video>
""" % data_url)
- https://developer.huaweicloud.com/develop/aigallery/notebook/detail?id=e62562a1-29d1-4c6b-a057-b7562f44c642
边栏推荐
- textarea disable drag and drop
- serialize 序列化原生方法
- Implementation of FIR filter based on FPGA (1) - using fir1 function design
- 作为一个十年卷王,告诫你们年轻人应该如何才能认清自己的价值
- String转成double等类型注意非空判断
- 客户案例 | 提高银行信用卡客户贡献率
- [8月4日]剑指 Offer 52. 两个链表的第一个公共节点
- 跟我一起了解云耀云服务器HECS【华为云至简致远】
- Using Flask and Celery to push real-time/timed messages asynchronously in Win10 environment (Socket.io)/The latest strategy in 2020
- 【JS高级】ES5标准规范之严格模式下的保护对象_09
猜你喜欢
随机推荐
教学习编程,第一步解决自信问题,培养自己的专注力
浅学一下二叉树链式存储结构的遍历
京东三面惨遭被虐,关于redis,高并发,分布式,问懵了
剑指 Offer 66. 构建乘积数组
优刻得“失速”:营收转降,定向增发股东浮亏超三成
PostgreSQL 用户与schema有什么区别?
Tsinghua | GLM-130B: An Open Bilingual Pre-training Model
Knowledge points and written test questions related to shift operations, bit operations, and logical operations
serialize serialize native method
6. [opencv mouse callback event]
Review: What is the pre-approval of autumn recruitment?What is an ordinary autumn move?It's all recruitment, why do you need to set these two recruitment time periods?
【系统设计】S3 对象存储
R语言patchwork包将多个ggplot2可视化结果组合起来、使用plot_annotation函数以及tag_level参数为组合图添加自定义编码序列(字符向量列表)
sample函数—R语言
「复盘」面试BAMT回来整理398道高频面试题,助你拿高薪offer
Implement a customized pin code input control
Verilog HDL Bits training 09 grammar foundation
接口测试,
Tensorflow and Keras for machine learning, deep learning
彻底了解什么是POE交换机!!!