Replies: 4 comments 4 replies
-
Thanks for the report, @ivysrono . It appears that there are two bugs in the documentation:
A full example is here (and here is a link to a code sandbox):
I will open a ticket to get this fixed across the MAXIM models. Thanks again for the report! Let me know if you're continuing to have issues. |
Beta Was this translation helpful? Give feedback.
-
first question: <script src="https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js"></script>
<script src="https://unpkg.com/@upscalerjs/maxim-denoising@latest/dist/umd/models/maxim-denoising/src/umd.min.js"></script>
<script src="https://unpkg.com/upscaler@latest/dist/browser/umd/upscaler.min.js"></script>
|
Beta Was this translation helpful? Give feedback.
-
second question: I create one user script: // ==UserScript==
// @name upscalerjs test
// @namespace Violentmonkey Scripts
// @match *://*/*
// @grant none
// @version 1.0
// @author -
// @require https://unpkg.com/upscaler@latest/dist/browser/umd/upscaler.min.js
// @require https://unpkg.com/@upscalerjs/maxim-denoising@latest/dist/umd/models/maxim-denoising/src/umd.min.js
// @require https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js
// @run-at document-idle
// ==/UserScript==
const upscaler = new Upscaler({
model: window.MaximDenoising,
});
upscaler
.upscale('https://upscalerjs.com/assets/images/fixture-51429144e4deb73beb431695c26a209c.png', {
patchSize: 64,
padding: 2,
progress: console.debug,
})
.then((upscaledImgSrc) => {
const img = document.createElement('img');
img.src = upscaledImgSrc;
document.head.appendChild(img);
}); console error: Uncaught (in promise) TypeError: n.registerOp is not a function
setup moz-extension://*/ upscalerjs test.user.js#54:3
re moz-extension://*/ upscalerjs test.user.js#54:2
<anonymous> moz-extension://*/ upscalerjs test.user.js#54:2
VMfdnqd912xto moz-extension://*/ upscalerjs test.user.js#54:38
VMfdnqd912xto moz-extension://*/ upscalerjs test.user.js#54:53
VMfdnqd912xto moz-extension://*/ upscalerjs test.user.js#54:53
Ut moz-extension://*/sandbox/injected-web.js:1
<anonymous> moz-extension://*/ upscalerjs test.user.js#54:1
Pe moz-extension://*/sandbox/injected-web.js:1
post moz-extension://*/sandbox/injected-web.js:1
ScriptData moz-extension://*/sandbox/injected-web.js:1
onHandle moz-extension://*/sandbox/injected-web.js:1
Le moz-extension://*/sandbox/injected-web.js:1
line 2 > injectedScript:3:794 |
Beta Was this translation helpful? Give feedback.
-
<html>
<head>
<title>@upscalerjs/maxim-denoising</title>
<style>
body {
padding: 40px;
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
button {
margin-top: 20px;
display: block;
padding: 10px 40px;
}
#target {
background: #eee;
border: 1px solid #ddd;
display: inline-block;
width: 256px;
height: 256px;
}
#flower {
border: 1px solid #ddd;
}
pre {
padding: 10px;
background: #eee;
border: 1px solid #ddd;
border-radius: 5px;
}
table td {
vertical-align: top;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<td>Original</td>
<td>Upscaled</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<img src="./img_code.jpg" id="fixture" />
</td>
<td>
<div id="target"></div>
</td>
</tr>
</tbody>
</table>
<script src="https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js"></script>
<script src="https://unpkg.com/@upscalerjs/maxim-denoising@latest/dist/umd/models/maxim-denoising/src/umd.min.js"></script>
<script src="https://unpkg.com/upscaler@latest/dist/browser/umd/upscaler.min.js"></script>
<script>
const upscaler = new window.Upscaler({
// model: window.MaximDenoising,
model: {
scale: 2,
path: 'https://unpkg.com/@upscalerjs/maxim-denoising@latest/models/model.json',
},
});
const fixture = document.getElementById('fixture');
upscaler
.upscale(fixture, {
patchSize: 64,
padding: 2,
progress: console.debug,
})
.then((upscaledImgSrc) => {
const img = document.createElement('img');
img.src = upscaledImgSrc;
document.getElementById('target').appendChild(img);
});
</script>
</body>
</html> Uncaught (in promise) Error: layer: Improper config format: {"node":[{"name":"StatefulPartitionedCall/jax2tf_apply_/Wrapper/backbone/stage_2_decoder_block_0/UNetEncoderBlock_0/channel_attention_block_11/channel_attention/jit_sigmoid_/Const_1","op":"Const","attr":{"value":{"tensor":{"dtype":"DTFLOAT","tensorShape":{}}},"dtype":{"type":"DTFLOAT"}},"inputs":[]},{"name":"StatefulPartitionedCall/jax2tf_apply_/Wrapper/backbone/stage_2_decoder_block_0/UNetEncoderBlock_0/channel_attention_block_11/jit_leaky_relu_/jit_fn_/Cast","op":"Const","attr":{"value":{"tensor":{"dtype":"DTFLOAT","tensorShape":{}}},"dtype":{"type":"DTFLOAT"}},"inputs":[]},{"name":"StatefulPartitionedCall/Const_7363","op":"Const","attr":{"value":{"tensor":{"dtype":"DTFLOAT","tensorShape":{}}},"dtype":{"type":"DTFLOAT"}},"inputs":[]},{"name":"StatefulPartitionedCall/jax2tf_apply_/Wrapper/backbone/stage_2_decoder_block_0/UNetEncoderBlock_0/channel_attention_block_11/LayerNorm/Const_1","op":"Const","attr":{"value":{"tensor":{"dtype":"DTINT32","tensorShape…
y https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
r https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
w https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
n https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
Vse https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
rle https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
e https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
h https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
w https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
x https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
u https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
o https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
promise callback*u https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
o https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
c https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
c https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
xhe https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
bhe https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
e https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
h https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
w https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
x https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
u https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
o https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
c https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
c https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
yhe https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
loadLayersModel https://unpkg.com/@tensorflow/tfjs@latest/dist/tf.min.js:17
j https://unpkg.com/upscaler@latest/dist/browser/umd/upscaler.min.js:2
model https://unpkg.com/upscaler@latest/dist/browser/umd/upscaler.min.js:2
loadModel https://unpkg.com/upscaler@latest/dist/browser/umd/upscaler.min.js:2
async* https://unpkg.com/upscaler@latest/dist/browser/umd/upscaler.min.js:2
<anonymous> http://127.0.0.1/*/1.html:59
tf.min.js:17:10059 |
Beta Was this translation helpful? Give feedback.
-
@upscalerjs/maxim-denoising - npm links are 404.
I find https://upscalerjs.com/models/available/denoising/maxim-denoising/
However, the script tag error:
Couldn't find the requested file /dist/umd/index.min.js in @upscalerjs/maxim-denoising.
Maybe it is
https://cdn.jsdelivr.net/npm/@upscalerjs/maxim-denoising@latest/dist/umd/models/maxim-denoising/src/umd.min.js
?Beta Was this translation helpful? Give feedback.
All reactions