Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th September 2018, 05:09   #1  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
mxnet : vs_mxDnCNN function

Is there anyone who can help with getting this to work? I like to test it.

https://github.com/kice/vs_mxDnCNN

I installed the required data in the vs plugins folder and installed mxnet using pip.

I get an error saying no module named.....

I tried mx and mxnet, none worked.


Code:
def NeuralDenoise(c, strength=88):
	even = core.mx.mxDNCNN(core.std.SelectEvery(c, 2, 0), param=strength, ctx=2, dev_id=0)
	odd = core.mx.mxDNCNN(core.std.SelectEvery(c, 2, 1), param=strength, ctx=2, dev_id=1)
	return core.std.Interleave([even, odd])
Cary Knoop is offline   Reply With Quote
Old 8th September 2018, 06:03   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
You do have a multi-device setup, yes?
Otherwise you should probably simply use:
Code:
clip = core.mx.mxDNCNN(clip, param=88, ctx=2, dev_id=0)
and adjust param to change the strength,...
(haven't tested the filter myself, but that seemed an obvious question)
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 8th September 2018, 06:18   #3  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Quote:
Originally Posted by Selur View Post
You do have a multi-device setup, yes?
Otherwise you should probably simply use:
Code:
clip = core.mx.mxDNCNN(clip, param=88, ctx=2, dev_id=0)
and adjust param to change the strength,...
(haven't tested the filter myself, but that seemed an obvious question)
Yes, I have a multi-device setup.

Ah, found out that the actual plugin is separate:
https://github.com/kice/vs_mxDnCNN/releases

It "works" now, I don't get a denoised image though, but it seems to return some kind of noise, am I suppose to subtract it from the image?

Last edited by Cary Knoop; 8th September 2018 at 06:26.
Cary Knoop is offline   Reply With Quote
Old 8th September 2018, 06:34   #4  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Cary Knoop View Post
It "works" now, I don't get a denoised image though, but it seems to return some kind of noise, am I suppose to subtract it from the image?
Yes, MakeDiff - there is an example on the usage page
poisondeathray is offline   Reply With Quote
Old 8th September 2018, 06:39   #5  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Quote:
Originally Posted by poisondeathray View Post
Yes, MakeDiff - there is an example on the usage page
Where is the usage page, I only see the readme?
Cary Knoop is offline   Reply With Quote
Old 8th September 2018, 06:40   #6  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Cary Knoop View Post
Where is the usage page, I only see the readme?
You linked to it in the first post There is a usage section

https://github.com/kice/vs_mxDnCNN
poisondeathray is offline   Reply With Quote
Old 8th September 2018, 06:44   #7  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
But there is typo , it should be core.std.MakeDiff not std.core.MakeDiff
poisondeathray is offline   Reply With Quote
Old 8th September 2018, 06:54   #8  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Thanks! It is working now.

88 is very strong, 125 starts to look better, but hf details are definitely touched.

Also, the resulting image gives me some artifacts near the top spanning the full width of the frame.
Attached Images
 

Last edited by Cary Knoop; 8th September 2018 at 07:02.
Cary Knoop is offline   Reply With Quote
Old 8th September 2018, 07:03   #9  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Yes, it would be nicer if it had more settings , more than 2 param data. I wonder how difficult it would be to generate ? In the dncnn folder , I'm assuming DnCNN88-0000.params, and DnCNN125-0000.params refer to 88 and 125
poisondeathray is offline   Reply With Quote
Old 8th September 2018, 07:07   #10  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Cary Knoop View Post

Also, the resulting image gives me some artifacts near the top spanning the full width of the frame.
attachments can take a while to get approved...sometimes days

people tend to use free 3rd party image hosting sites e.g https://postimages.org/
poisondeathray is offline   Reply With Quote
Old 8th September 2018, 07:29   #11  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Ok, here is a dropbox of a fraction of a frame showing the issue:
https://www.dropbox.com/s/29s3qcm9jb...te-01.jpg?dl=0

I suppose it is avoidable by adding some extra black space to the top of the video frames.
Cary Knoop is offline   Reply With Quote
Old 8th September 2018, 08:07   #12  |  Link
Wolfberry
Helenium(Easter)
 
Wolfberry's Avatar
 
Join Date: Aug 2017
Location: Hsinchu, Taiwan
Posts: 99
You can also try DnCNN made by WolframRhodium. Usage is in info.md

Main function: muvsfunc_numpy.super_resolution()
__________________
Monochrome Anomaly
Wolfberry is offline   Reply With Quote
Old 9th September 2018, 12:57   #13  |  Link
kice
Registered User
 
Join Date: Sep 2015
Posts: 1
Try this out:

https://github.com/kice/vs_mxnet
kice is offline   Reply With Quote
Old 9th September 2018, 14:14   #14  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
@kice vs_mxnet and vs_mxDnCNN have the same namespace "mx", maybe you could change one to avoid conflicts?
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database

Last edited by ChaosKing; 9th September 2018 at 14:16.
ChaosKing is offline   Reply With Quote
Old 9th September 2018, 17:27   #15  |  Link
WolframRhodium
Registered User
 
Join Date: Jan 2016
Posts: 162
Quote:
Originally Posted by ChaosKing View Post
@kice vs_mxnet and vs_mxDnCNN have the same namespace "mx", maybe you could change one to avoid conflicts?
I believe vs_mxDnCNN has been deprecated. Use vs_mxnet instead.

I will try to make a comparison between vs_mxDnCNN and vs_mxnet:

The former one is too specific:
It tailored to the DnCNN models that were trained by him in early days, only works on YUV444 data, and it does not support models for super-resolution which enlarge images.

The later one is more general:
It currently has RGB and gray scale support, and can work on versatile models like super-resolution models. (waifu2x for example. See model-zoo. And I have also written a wrapper function for it. You can go to demo for more information)

Last edited by WolframRhodium; 10th September 2018 at 01:05.
WolframRhodium is offline   Reply With Quote
Old 9th September 2018, 20:07   #16  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Thanks for all the new stuff to play with!

Does anyone have any comments / general impressions for any of the models , or any interesting examples outside of the pdf /original research papers ?
poisondeathray is offline   Reply With Quote
Old 13th October 2018, 17:58   #17  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Has anyone had this problem:
Code:
Cannot load MXNet. Please install MXNet
when starting a script?

If i import mxnet from python's REPL it seems to work, but from this script
Code:
import vapoursynth as vs
import MFunc as mon
import havsfunc as has
import nnedi3_resample

core = vs.get_core()

src = mon.Source("file:///D:/Working/video_source (1).mkv", False)

srcf = nnedi3_resample.nnedi3_resample(src, 1920,1080, csp=vs.RGBS, fast=True, chromak_up="bicubic")
#srcf = core.fmtc.bitdepth(src, flt=True)

#denMV = mon.Denoise2(src, 500, blksize=16, fast=False)
denNN = core.mx.Predict(srcf, "DnCNN-S-15-symbol.json", "DnCNN-S-15-0000.params", ctx=2, scale=1)
#, patch_w, patch_h, scale, output_w, output_h, frame_w, frame_h, step_w, step_h, outstep_w, outstep_h, padding, boder_type, dev_id)

denNN = core.fmtc.bitdepth(denNN, bits=8)

srcf.set_output()
it give me that error.

Any suggestion?
MonoS is offline   Reply With Quote
Old 14th October 2018, 01:37   #18  |  Link
WolframRhodium
Registered User
 
Join Date: Jan 2016
Posts: 162
Quote:
Originally Posted by MonoS View Post
Has anyone had this problem:
Code:
Cannot load MXNet. Please install MXNet
when starting a script?

If i import mxnet from python's REPL it seems to work, but from this script

Any suggestion?
MXNet should be loaded explicitly via "import mxnet".
WolframRhodium is offline   Reply With Quote
Old 14th October 2018, 11:49   #19  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Quote:
Originally Posted by WolframRhodium View Post
MXNet should be loaded explicitly via "import mxnet".
Thank you, this solved the problem
I guess there are some bug in your muvsfunc regarding YUV clip, for example the ShufflePlanes at line 4380 should result in [0,0,0], not [0,1,2]
MonoS is offline   Reply With Quote
Old 14th October 2018, 14:14   #20  |  Link
WolframRhodium
Registered User
 
Join Date: Jan 2016
Posts: 162
Quote:
Originally Posted by MonoS View Post
Thank you, this solved the problem
I guess there are some bug in your muvsfunc regarding YUV clip, for example the ShufflePlanes at line 4380 should result in [0,0,0], not [0,1,2]

This bug has been identified and fixed at previous commit 5bbb212.
I always post the code at specific commit rather than at latest status in this forum for clarity. In this case the latest code on GitHub has been fixed while link in this forum was not. Sorry for the inconvenience.

Last edited by WolframRhodium; 14th October 2018 at 14:37.
WolframRhodium is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:36.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.