← 开源
reiinakano

arbitrary-image-stylization-tfjs

Arbitrary style transfer using TensorFlow.js

ApplicationsContent creationJavaScript
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
1.21k
Star
212
Fork
+0
本周
2
贡献者
创建于 2018-11-13 · 更新于 2026-09-14 · 今日第 11151 名
主要开发者

reiinakano/arbitrary-image-stylization-tfjs 排名第 11,151,有 1,205 个星标。

同类别比较

reiinakano/arbitrary-image-stylization-tfjs 排名第 11,151,此处有 8 个同类条目;xalgorix/xalgorix 排名第 11,146。

同类别比较
名称排名指标
farzaa/DeepLeague11,127
语言:
Python
星标数:
1,211
分叉数:
178
简介:
(Open Source) Computer Vision + Deep Learning + League of Legends
modal-labs/quillman11,130
语言:
Python
星标数:
1,211
分叉数:
160
简介:
A voice chat app
nishuzumi/gemini-teacher11,138
语言:
Python
星标数:
1,209
分叉数:
145
简介:
English pronunciation correction teacher built with gemini
xalgorix/xalgorix11,146
语言:
Go
星标数:
1,206
分叉数:
228
Sec-Link/Argus-Agentic-SOC-Platform11,164
语言:
Python
星标数:
1,203
分叉数:
84
简介:
An open source AI-native agentic SOC platform
polterguy/magic11,172
语言:
C#
星标数:
1,202
分叉数:
175
简介:
Instant SECURE Full Stack Apps and AI Agents
YaoFANGUK/video-subtitle-generator11,187
语言:
Python
星标数:
1,198
分叉数:
209
简介:
视频音频生成字幕,生成srt文件。无需申请第三方API,本地实现音频转文本。基于Transformer的视频字幕生成框架。A GUI tool for generating subtitle from videos and generating srt files.
austin-weeks/miasma11,188
语言:
Rust
星标数:
1,198
分叉数:
42
简介:
Trap AI web scrapers in an endless poison pit.
关键参数与规格
关键参数与规格
参数值
语言JavaScript
类别Applications
子类别Content creation
关键词Image production
星标数1,205
分叉数212
贡献者2
创建日期2018-11-13
更新日期2026-09-14
1 天星标数0
7 天星标数0
排名11,151
上次排名11,101
排名变化-50
7 天星标排名12,912
上次 7 天星标排名12,923
7 天星标排名变化11
总星标排名9,663
上次总星标排名9,654
总星标排名变化-9
国家USA
README 摘录

js This repository contains an implementation of arbitrary style transfer running fully inside the browser using TensorFlow. Demo website: Blog post with more details: Stylize an image Combine styles FAQ What is this? This is an implementation of an arbitrary style transfer algorithm running purely in the browser using TensorFlow. As with all neural style transfer algorithms, a neural network attempts to "draw" one picture, the Content (usually a photograph), in the style of another, the Style (usually a painting

). Although other browser implementations of style transfer exist, they are normally limited to a pre-selected handful of styles, due to the requirement that a separate neural network must be trained for each style image. Arbitrary style transfer works around this limitation by using a separate *style network* that learns to break down *any* image into a 100-dimensional vector representing its style. This style vector is then fed into another network, the *transformer network*, along with the content image

, to produce the final stylized image. I have written a blog post explaining this project in more detail. Your data and pictures here never leave your computer! In fact, this is one of the main advantages of running neural networks in your browser. Instead of sending us your data, we send *you* both the model *and* the code to run the model. The original paper uses an Inception-v3 model as the style network, which takes up ~36. 3MB when

ported to the browser as a FrozenModel. In order to make this model smaller, a MobileNet-v2 was used to distill the knowledge from the pretrained Inception-v3 style network. This resulted in a size reduction of just under 4x, from ~36. For the transformer network, the original paper uses a model using plain convolution layers. When ported to the browser, this model takes up 7. 9MB and is responsible for the majority of the calculations during stylization. In order

to make the transformer model more efficient, most of the plain convolution layers were replaced with depthwise separable convolutions. 4MB, while drastically improving the speed of stylization. This demo lets you use any combination of the models, defaulting to the MobileNet-v2 style network and the separable convolution transformer network. 6MB, while the separable convolution transformer network is ~2. Since these models work for any style, you only have to download them once! Since each style can be mapped to

a 100-dimensional style vector by the style network, we simply take a weighted average of the two to get a new style vector for the transformer network. This is also how we are able to control the strength of stylization. We take a weighted average of the style vectors of *both* content and style images and use it as input to the transformer network. Running locally for development This project uses Yarn for dependencies. To run it locally, you

must install Yarn and run the following command at the repository's root to get all the dependencies. Then, you can

常见问题

记录了多少星标和分叉?

reiinakano/arbitrary-image-stylization-tfjs 有 1,205 个星标和 212 个分叉。

仓库排名是多少?

reiinakano/arbitrary-image-stylization-tfjs 排名第 11,151。

记录的语言和类别是什么?

reiinakano/arbitrary-image-stylization-tfjs 有 1,205 个星标,语言为 JavaScript,类别为 Applications。

哪个仓库排名最接近?

reiinakano/arbitrary-image-stylization-tfjs 与 xalgorix/xalgorix 比较,后者排名第 11,146,有 1,206 个星标。

README

Arbitrary style transfer in TensorFlow.js

This repository contains an implementation of arbitrary style transfer running fully inside the browser using TensorFlow.js.

Demo website: https://reiinakano.github.io/arbitrary-image-stylization-tfjs

Blog post with more details: https://magenta.tensorflow.org/blog/2018/12/20/style-transfer-js/

Stylize an image

Combine styles

FAQ

What is this?

This is an implementation of an arbitrary style transfer algorithm running purely in the browser using TensorFlow.js. As with all neural style transfer algorithms, a neural network attempts to "draw" one picture, the Content (usually a photograph), in the style of another, the Style (usually a painting).

Although other browser implementations of style transfer exist, they are normally limited to a pre-selected handful of styles, due to the requirement that a separate neural network must be trained for each style image.

Arbitrary style transfer works around this limitation by using a separate style network that learns to break down any image into a 100-dimensional vector representing its style. This style vector is then fed into another network, the transformer network, along with the content image, to produce the final stylized image.

I have written a blog post explaining this project in more detail.

Is my data safe? Can you see my pictures?

Your data and pictures here never leave your computer! In fact, this is one of the main advantages of running neural networks in your browser. Instead of sending us your data, we send you both the model and the code to run the model. These are then run by your browser.

What are all these different models?

The original paper uses an Inception-v3 model as the style network, which takes up ~36.3MB when ported to the browser as a FrozenModel.

In order to make this model smaller, a MobileNet-v2 was used to distill the knowledge from the pretrained Inception-v3 style network. This resulted in a size reduction of just under 4x, from ~36.3MB to ~9.6MB, at the expense of some quality.

For the transformer network, the original paper uses a model using plain convolution layers. When ported to the browser, this model takes up 7.9MB and is responsible for the majority of the calculations during stylization.

In order to make the transformer model more efficient, most of the plain convolution layers were replaced with depthwise separable convolutions. This reduced the model size to 2.4MB, while drastically improving the speed of stylization.

This demo lets you use any combination of the models, defaulting to the MobileNet-v2 style network and the separable convolution transformer network.

How big are the models I'm downloading?

The distilled style network is ~9.6MB, while the separable convolution transformer network is ~2.4MB, for a total of ~12MB. Since these models work for any style, you only have to download them once!

How does style combination work?

Since each style can be mapped to a 100-dimensional style vector by the style network, we simply take a weighted average of the two to get a new style vector for the transformer network.

This is also how we are able to control the strength of stylization. We take a weighted average of the style vectors of both content and style images and use it as input to the transformer network.

Running locally for development

This project uses Yarn for dependencies.

To run it locally, you must install Yarn and run the following command at the repository's root to get all the dependencies.

yarn run prep

Then, you can run

yarn run start

You can then browse to localhost:9966 to view the application.

Credits

This demo could not have been done without the following:

As a final note, I'd love to hear from people interested in making a suite of tools for artistically manipulating images, kind of like Magenta Studio but for images. Please reach out if you're planning to build/are building one out!

排名相邻
同类项目