Comments (6)
TensorFlow.js is just a later version of deeplearn.js renamed. Results won't actually change (in theory), although maybe it'll be more efficient and run on more platforms, who knows.
from fast-style-transfer-deeplearnjs.
Extracted the code from StyleSight into a simple standalone file:
https://gist.github.com/mikeemoo/b4affe711d56bd9828e8db7ce73ae13c
import { loadStyle, predict } from "./net";
const img = new Image();
img.onload = async () => {
loadStyle("udnie").then(async style => {
const result = predict(img, style);
const data = await result.data();
const [height, width] = result.shape;
... do whatever
});
img.src = "...jpg";
Seems extremely slow at the moment, though! Crashes my little laptop with anything bigger than a couple of hundred pixels.
from fast-style-transfer-deeplearnjs.
I'm just posting here to register my interest in this - I know nothing about tensorflow or deeplearn so won't be able to help, but very interested in playing with the result.
from fast-style-transfer-deeplearnjs.
This might be relevant to see: https://github.com/zaidalyafeai/Fast-Style-Transfer-Keras-TF.js
Althought the repo says:
This is done using tensorflow.js check the file fast-style.html. Note that I have and editted version of the source package tf.min.js. It containts many custom layers like corpping and upsampling that are yet to be implemented in tf.js. Make sure to use that file.
from fast-style-transfer-deeplearnjs.
I got this working with tensorflowjs over here https://github.com/DanRuta/StyleSight, on a separate demo project.
One thing I couldn't get working the same was the GPU -> GPU output rendering, to skip sending the values through the CPU first. I couldn't find the new way to do it, if there is still one.
If it'd be helpful to anyone, I could isolate it into a separate repo, without anything unrelated, like build tools, libraries, or frameworks.
from fast-style-transfer-deeplearnjs.
Nice one! :) Yep, that happens for me, also. I've noticed GPU memory leaks on several tensorflowjs projects (not just my own), so maybe there's an issue with tfjs.
As for the speed, I think it may be a little faster with GPU -> GPU output rendering, but even so, the model is quite complex. Even with a small resolution input, I don't get more than a few frames per second, on a 1080.
from fast-style-transfer-deeplearnjs.
Related Issues (15)
- Build and deploy HOT 1
- Bower HOT 1
- Error in net.ts
- Porting some new TensorFlow models HOT 2
- Feedforward image colorization
- A neural algorithm of artistic style
- mobile browser HOT 2
- C# implementation HOT 1
- How to Deploy on GitHub Pages (if you did)
- Uncaught SyntaxError: Unexpected token v in JSON at position 0 HOT 4
- 404 on bundle.js HOT 2
- DemoSite Error - ReferenceError: dialogPolyfill is not defined HOT 4
- Reference image does not match output (NOTE: Please post your browser and system specs here if you face this issue) HOT 7
- 'Repository has exceeded LFS data quota' - LFS really needed? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fast-style-transfer-deeplearnjs.