Comments (6)
Hi Francesco,
It worked! Thanks for your help! I'm building a small open source web app using the pre trained model and weights to enable users to do super resolution in the browser. I will let you know when it's ready so you can check it out. Cheers.
from image-super-resolution.
I'm guessing that the problems might stem from the fact that only the weights are saved, not the entire model. Looking at the checkpoint callback, we have save_weights_only=True
checkpoint_PSNR = ModelCheckpoint(
self.checkpoint_paths['PSNR'],
save_weights_only=True,
verbose=self.verbose,
save_best_only=True,
monitor='PSNR',
mode='max',
)
I'd suggest you to try to load the model, load the weights and then dump the model to a .h5 file with model.save()
Let me know if this helps!
from image-super-resolution.
Hi @GregFrench i'm trying to use this on tfjs too but i can't seem to make it work. Getting this error:
Error: Error when checking : expected LR to have 4 dimension(s), but got array with shape [128,128,4]
I'm trying to upscale 128x128 images. Could you share a bit more about your process?
from image-super-resolution.
For processing the images in Tensorflow.js I used the same code in JavaScript that the Python implementation was using:
let tensor = tf.fromPixels(url).toFloat().div(tf.scalar(255)).expandDims();
let prediction = await model.predict(tensor).clipByValue(0, 1).mul(tf.scalar(255)).data();
Where url = the URL of the image or image data from a web form.
I hope that helps!
from image-super-resolution.
Lifesaver.... had to some workarounds because i'm on node, not on browser, but super!!
Users load the model on the browser? how long does it take?
from image-super-resolution.
I just timed it and it took 5 minutes to load the model in the browser. You can check out the implementation here using create react app and GitHub pages: https://github.com/GregFrench/super-resolution.
The app also crashes when trying to process images over 150x150 pixels due to some WebGL issue that I was never able to figure out the cause of. So it seems like it is probably best to run inference on the model through a server rather than a browser which is a little disappointing.
from image-super-resolution.
Related Issues (20)
- super resolution for 3d data clouds
- ValueError: Input 0 of layer "generator" is incompatible with the layer HOT 1
- ISR Dependency functools32 Fails Install using Poetry HOT 2
- colab
- conflicting dependencies HOT 5
- predict image conatins many abnormal pixel block
- Download model weights connection timed out HOT 1
- none
- Can't install on colab HOT 2
- Export to tflite model
- pip installation fails on modern images (Colab, Kaggle) HOT 3
- Increasing value of step_per_epoch give unexpected outputs
- macOS install error HOT 1
- Training on greyscale dataset HOT 1
- Optimizer problem HOT 1
- Upload to TFLITE
- Converted to TFLITE.
- How to return history of validation generator loss in ISR
- a
- #CPU issue 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 image-super-resolution.