Log in

View Full Version : ONNX models to use with avs-mlrt


Pages : [1] 2 3

Reel.Deel
26th February 2023, 03:43
PyTorch models converted to ONNX to use with AviSynth+'s avs-mlrt plugin (https://github.com/Asd-g/avs-mlrt). Models were converted with chaiNNer (https://github.com/chaiNNer-org/chaiNNer) (fp32 data type). Let me know of missing models to convert and I'll add them to the package.


Download: onnx-models-rd (https://www.dropbox.com/sh/f74ao9t1qarffok/AACfLoG7-F8MvWSfwifgr6M4a?dl=0)

Other repositories that include onnx models:

Large collection of onnx models: https://github.com/styler00dollar/VSGAN-tensorrt-docker/releases/tag/models

2x_AnimeJaNai - https://github.com/the-database/mpv-upscale-2x_animejanai/

Phhofm models (some already onnx): https://github.com/Phhofm/models


Model database

https://upscale.wiki/wiki/Model_Database

https://openmodeldb.info/


Basic usage
FFVideoSource("YUV420Source.mkv")
ConvertBits(32)
ConvertToPlanarRGB()
mlrt_ncnn(network_path="1x_Dotzilla_Compact_80k_net_g.onnx", builtin=false)
You can omit the builtin parameter if the models are in the same location as the avs-mlrt plugin (see builtin and builtindir parameters in the docs).

If you have a low end GPU and trying to use the larger models, it helps to use the tilesize, overlap and fp16 options.
mlrt_ncnn(network_path=model, builtin=false, fp16=true, tilesize_w=width/4, tilesize_h=height/4, overlap_w=8, overlap_h=8)


Model conversion

Download chaiNNer (https://github.com/chaiNNer-org/chaiNNer) and install the required dependencies. Load the corresponding nodes, connect them and then hit run by either pressing the play button at the top or F5.

https://i.ibb.co/6P4DDMg/chainner-convert.png

Dogway
26th February 2023, 03:57
Woow, so great, ''thumbs up'', these are my go to for anime and manga. Still searching a good one for photos though.

Old Anime Upscale:
1x_Dotzilla_Compact_80k_net_g.pth (dot crawl and rainbowing)
2X_DigitalFilmV5_Lite.pth (sharpener for soft lines, no need to downscale before AI)
2x_AnimeClassics_UltraLite_510K.pth (less reconstruction than above, similar to Waifu but for Anime. Color Shift)
2x_LD-Anime_Skr_v1.0.pth (for ringing, rainbowing, aliasing)
Manga Upscale (B/W):
4x_eula_digimanga_bw_v1_860k.pth
Magazines?
4x-UniScaleV2_Moderate

kedautinh12
26th February 2023, 04:02
wow, so i think this will open new era about pytorch can port to avisynth

kedautinh12
26th February 2023, 04:03
Woow, so great, ''thumbs up'', these are my go to for anime and manga. Still searching a good one for photos though.

Old Anime Upscale:
1x_Dotzilla_Compact_80k_net_g.pth (dot crawl and rainbowing)
2X_DigitalFilmV5_Lite.pth (sharpener for soft lines, no need to downscale before AI)
2x_AnimeClassics_UltraLite_510K.pth (less reconstruction than above, similar to Waifu but for Anime. Color Shift)
2x_LD-Anime_Skr_v1.0.pth (for ringing, rainbowing, aliasing)
Manga Upscale (B/W):
4x_eula_digimanga_bw_v1_860k.pth
Magazines?
4x-UniScaleV2_Moderate

Can it use for real world video??

Reel.Deel
26th February 2023, 05:06
Woow, so great, ''thumbs up'', these are my go to for anime and manga. Still searching a good one for photos though.

Old Anime Upscale:
1x_Dotzilla_Compact_80k_net_g.pth (dot crawl and rainbowing)
2X_DigitalFilmV5_Lite.pth (sharpener for soft lines, no need to downscale before AI)
2x_AnimeClassics_UltraLite_510K.pth (less reconstruction than above, similar to Waifu but for Anime. Color Shift)
2x_LD-Anime_Skr_v1.0.pth (for ringing, rainbowing, aliasing)
Manga Upscale (B/W):
4x_eula_digimanga_bw_v1_860k.pth
Magazines?
4x-UniScaleV2_Moderate

Thanks for the suggestions. I added them to the package. I'll provide a Dropbox link from now on since the size is already at 331mb. This way people can pick and choose only the models they want. I did not test these new models, let's hope they don't blow up :)

Edit: if anyone has the "DeGif" model please share it. The link to it is not working right now (Public Transfer Limit Exceeded).

poisondeathray
26th February 2023, 05:17
Can it use for real world video??

Usually the models are quite narrow in scope; typically they are only useful on the data set that they were trained on, or very similar material. But you can try it...




Edit: if anyone has the "DeGif" model please share it. The link to it is not working right now (Public Transfer Limit Exceeded).

Which version ? There are older checkpoint versions and the most recent version I have is "2x_NMKD-DeGIF_210000_G.pth"

Reel.Deel
26th February 2023, 05:19
Which version ? There are older checkpoint versions and the most recent version I have is "2x_NMKD-DeGIF_210000_G.pth"

I guess the latest one. There is no version number on the upscale wiki.

poisondeathray
26th February 2023, 05:22
I mention it because sometimes an earlier checkpoint produces better results. Here are all the checkpoints for DeGif that I have. Credits to NMKD (n00mkrad)
https://www.mediafire.com/file/2jzoqomhrt88bsk/NMKD+DeGIF.7z/file

Just curious :
1) how long does it take to convert ?
2) are results bit identical to the pytorch version?

Reel.Deel
26th February 2023, 05:33
I mention it because sometimes an earlier checkpoint produces better results. Here are all the checkpoints for DeGif that I have. Credits to NMKD (n00mkrad)
https://www.mediafire.com/file/2jzoqomhrt88bsk/NMKD+DeGIF.7z/file

Just curious :
1) how long does it take to convert ?
2) are results bit identical to the pytorch version?

Thanks for the models.

1) Depends on the size of the model. Small ones are quick (few seconds), the largest one I converted (64mb) took around a minute.

2) I have not compared them to the original version. It would be interesting to do so. But while researching how to convert between the two formats I only saw that mentioned once or twice. See here: https://www.reddit.com/r/MachineLearning/comments/hqqymm/dhow_much_can_converting_a_torch_model_to_onnx/ and here https://pytorch.org/docs/stable/onnx.html#limitations

I'm all ears if anyone has any suggestions.

This is the interface in ChaiNNer:
https://i.ibb.co/RNTcP0p/chainner.png
I'm sure there more options when using PyTorch directly but I have not experimented with that.

Edit: can someone test the 2x_LD-Anime_Skr_v1.0.pth model? It crashes on me.

Arx1meD
26th February 2023, 09:00
This plugin works on GPU only?

DTL
26th February 2023, 11:56
For denoise process (in physical temporal dimension) we need models for motion compensation. The framerate interpolation models are only partially good for this processing. Better neural network engines for motion compensation need accept several input frames in a sequence (not only 2 frames as we have in RIFE now).

The 'training condition' for motion compensation process is simple enough: For given number of frames with marked 'current' frame it is required to create 'current' frame view using only 'other' frames. In simplest form with 2 frame only input - we have only 'current' and 'other' frame. So engine need to reconstruct 'current' frame using only samples data from 'other' frame (it can use 'current' frame only as 'objects positions reference').

It may be even more simple in compare with 'framerate conversion' process where engine have 2 frames 'before and after' and 'current' frame to reconstruct at time of model training.

Can it use for real world video??

One issue I found when trying to use online AI upscalers - they may not understand the depth of field blur and start to attempt to make out of focus objects sharper too. So for simple 2D drawing without textures like anime it work for sharp lines restoration from aliasing and all frame deblur about good. But for 3D real world lens projection to 2D buffer + different type (and DOF blur) textures it may fail significantly.

Dogway
26th February 2023, 15:34
Edit: can someone test the 2x_LD-Anime_Skr_v1.0.pth model? It crashes on me.

Didn't crash for me, but the GPU got high rolling for a few seconds... scared.

Does anyone know of a good inpaint model? I only know 1x_NMKD-YandereInpaint_375000_G and 1x_sudo_inpaint_PartialConv2D_424000_G but not sure which one might be better for opaque logos on live action content.

1x_JPEG_60-80.pth can also be good for deblocking old codec sources, need to compare with 1x-Kim2091_DeJpeg.onnx.

anton_foy
26th February 2023, 16:10
DTL: The 'training condition' for motion compensation process is simple enough: For given number of frames with marked 'current' frame it is required to create 'current' frame view using only 'other' frames. In simplest form with 2 frame only input - we have only 'current' and 'other' frame. So engine need to reconstruct 'current' frame using only samples data from 'other' frame (it can use 'current' frame only as 'objects positions reference').

It may be even more simple in compare with 'framerate conversion' process where engine have 2 frames 'before and after' and 'current' frame to reconstruct at time of model training.

Tried to find any model for this kind of motion compensation but without success. One would think there would be some out there? Although I do not specifically know what words to use for searching. I tried "model pytorch motion compensation" but mostly got hits about object tracking and similar.

Edit: if someone knows how to do the training bit I can provide with before/after tests in UHD (Sony does 6k then downscales internally to 3840x2160 and it is so crisp with minimal halo when internal sharpness is turned off).

poisondeathray
26th February 2023, 17:14
Does anyone know of a good inpaint model? I only know 1x_NMKD-YandereInpaint_375000_G and 1x_sudo_inpaint_PartialConv2D_424000_G but not sure which one might be better for opaque logos on live action content.


There are some inpainting algos that use different architectures (cannot be run in avs/vpy/cupscale)

https://github.com/geekyutao/Image-Inpainting
https://github.com/zengyh1900/Awesome-Image-Inpainting

The problem I found with single image/spatial inpainting algos, is the flicker and temporal inconsistencies (you'd have to apply some temporal smoothing after)

Many of them are difficult to get working (at least for me, on Windows) . An interesting one that I actually got to work, and is video inpainting (temporal +/- 3 frames) is OPN . Worked ok for some sources, not for others. YMMV
https://github.com/seoungwugoh/opn-demo


Chainner lists support for 2 spatial algos that I haven't tried yet; but they should "work" since the GUI has direct support

Lama
https://github.com/advimman/lama

MAT
https://github.com/fenglinglwb/MAT





Tried to find any model for this kind of motion compensation but without success. One would think there would be some out there? Although I do not specifically know what words to use for searching. I tried "model pytorch motion compensation" but mostly got hits about object tracking and similar.


Object tracking is part of it. Also propogation and alignment.

There are typically catergorized into single image vs. video . "Video" algorithms takes >1 frame into account. All the ESRGAN / Real-ESRGAN derivatives are single image only.

Examples of "video" algorithms that use "propogation", "alignment" at runtime are VRT, RVRT, BasicVSR++, RealBasicVSR. At runtime is important because feature are matched in adjacent frames in the specific input video.

Beware video algorithms take lots of memory. Some of them have "tiling" options built in, but the results can be worse especially for operations like deblurring. The whole frame in +/- n frames should be compared on some tasks, otherwise you get discontinunities at the tile boundaries

I posted some examples of BasicVSR/BasicVSR++ in a few threads here and other forums. The provided model works on "textbook" clean cases. A big problem for is degradation step wasn't included , so it's not as generalizable to real world, compression cases. RealBasicVSR adds degradation, but the results are quite blurry / detail loss

poisondeathray
26th February 2023, 17:22
Edit: can someone test the 2x_LD-Anime_Skr_v1.0.pth model? It crashes on me.

Could be GPU memory ?

Did you try the tiling options ?


- overlap_w, overlap_h\
Overlap width and overlap height of the tiles, respectively.\
Must be less than or equal to `tilesize_w` / `tilesize_h` `/` `2`.\
Default: 0.

- tilesize_w, tilesize_h\
Tile width and height, respectively.\
Use smaller value to reduce GPU memory usage.\
Must be specified when `overlap_w` / `overlap_h` > 0.\
Default: input_width, input_height.



And I tried a few ONNX converted models , they were bit identical to the pytorch version so far...

DonCanjas
26th February 2023, 17:34
Would like to see


4x_eula_digimanga_bw_v2_nc1_307k
MangaJPEG
1x_GainRESV3 (Aggro,Natural,Passive)
1x_DitherDeleter-Smooth_104000_G

kedautinh12
26th February 2023, 17:48
@VX will happy if had delogo models work perfectly:D

poisondeathray
26th February 2023, 17:57
And I tried a few ONNX converted models , they were bit identical to the pytorch version so far...

Ok, some very minor differences (only detectable on amplified differences) between avs, chainner using onnx and vs. pytorch in some cases, when settings are the same (e.g. tiles) . I think some of them might be due to the way it's converted to float or perhaps [0,1] clipping. The differences are so minor they are nothing to worry about

poisondeathray
26th February 2023, 18:01
This plugin works on GPU only?

I think so, the requirements say Vulkan device. I do not see a "CPU" mode anywhere

https://github.com/Asd-g/avs-mlrt

DTL
26th February 2023, 18:05
Examples of "video" algorithms that use "propogation", "alignment" at runtime are VRT, RVRT, BasicVSR++, RealBasicVSR. At runtime is important because feature are matched in adjacent frames in the specific input video.

Beware video algorithms take lots of memory. Some of them have "tiling" options built in, but the results can be worse especially for operations like deblurring. The whole frame in +/- n frames should be compared on some tasks, otherwise you get discontinunities at the tile boundaries


And what is the current RIFE is based at ? Or it is separated engine for doing motion interpolation ? Some wiki https://www.svp-team.com/wiki/RIFE_AI_interpolation says it is based on IFNet neural network.
Also it shows TensorRT at NVIDIA cards can run RIFE about 2x faster in compare with ncnn/Vulkan implementation. So RIFE (IFNet ?) can be compiled (?) to different hardware APIs ?

As for only storing frames in memory - the 1920x1080 frame in 12bytes per sample RGB 32bit float is about 24 MB only. So 1/4 of 1GB onboard RAM can keep 10 frames and it is very good already to study how motion is going between several frames.

I post an issue on some RIFE development project at github about possible changing RIFE algorithm for better denoise process - https://github.com/megvii-research/ECCV2022-RIFE/issues/304 but still no one reply. May be it require to search someone with understanding how RIFE work so the required changes can be implemented.

kedautinh12
26th February 2023, 18:07
Can ask Asd-g about RIFE??

Dogway
26th February 2023, 18:09
Many of them are difficult to get working (at least for me, on Windows) . An interesting one that I actually got to work, and is video inpainting (temporal +/- 3 frames) is OPN . Worked ok for some sources, not for others. YMMV
https://github.com/seoungwugoh/opn-demo

Thanks a lot, yes I wonder why temporal information isn't used more frequently in inpainting. I mean it has huge potential not only in restoration but also VFX. I will give it a stab when I'm in Win10.

poisondeathray
26th February 2023, 18:27
And what is the current RIFE is based at ? Or it is separated engine for doing motion interpolation ?


I don't understand the question - RIFE is flow based frame prediction (intermediate frame(s) synthesized between 2 source frames) .

The video SR/deblurring/denoising algos mentioned are multiframe bidirectional ...n-3, n-2, n-1, n, n+1, n+2, n+3... you can set 30, 50 or more frames if you wanted to


Some wiki https://www.svp-team.com/wiki/RIFE_AI_interpolation says it is based on IFNet neural network.
Also it shows TensorRT at NVIDIA cards can run RIFE about 2x faster in compare with ncnn/Vulkan implementation. So RIFE (IFNet ?) can be compiled (?) to different hardware APIs ?


Yes, different implementations are possible

Yes, TensorRT is usually the fastest implementation for all machine learning algorithms, not just rife .



As for only storing frames in memory - the 1920x1080 frame in 12bytes per sample RGB 32bit float is about 24 MB only. So 1/4 of 1GB onboard RAM can keep 10 frames and it is very good already to study how motion is going between several frames.


GPU memory, not system memory . And it's not just the additive frame memory; pytorch /TensorRT/ NCNN, all of them - consume extra reserve memory for operations .



I post an issue on some RIFE development project at github about possible changing RIFE algorithm for better denoise process - https://github.com/megvii-research/ECCV2022-RIFE/issues/304 but still no one reply. May be it require to search someone with understanding how RIFE work so the required changes can be implemented.

I haven't had a chance to look at it yet, but I'm not sure that RIFE would add much over for the mocomp over say mvtools2, and it would be slower

anton_foy
26th February 2023, 18:34
Object tracking is part of it. Also propogation and alignment.

There are typically catergorized into single image vs. video . "Video" algorithms takes >1 frame into account. All the ESRGAN / Real-ESRGAN derivatives are single image only.

Examples of "video" algorithms that use "propogation", "alignment" at runtime are VRT, RVRT, BasicVSR++, RealBasicVSR. At runtime is important because feature are matched in adjacent frames in the specific input video.

Beware video algorithms take lots of memory. Some of them have "tiling" options built in, but the results can be worse especially for operations like deblurring. The whole frame in +/- n frames should be compared on some tasks, otherwise you get discontinunities at the tile boundaries

I posted some examples of BasicVSR/BasicVSR++ in a few threads here and other forums. The provided model works on "textbook" clean cases. A big problem for is degradation step wasn't included , so it's not as generalizable to real world, compression cases. RealBasicVSR adds degradation, but the results are quite blurry / detail loss

Thanks for the thorough reply. I tried DPIR but had to downscale from uhd to 1280x720 for it to run and then it runs pretty fast but runs not at all above that resolution.

Even if it is only "spatial" denoising it can be used before MSuper() spatialfilter.MSuper()
and then Mdegrain to "smooth" out the motion jitter.
Usually I do this with fft3dfilter and mdegrain but maybe there is some better way to stabilize the motion jitter/wobble caused by noise.

Very curious to try the noise models in the model_database link REEL.DEEL posted, especially the "1x_ISO_denoise_v1" and v2 and "Film-Degrainer_1-000".

Reel.Deel
26th February 2023, 18:37
Ok, some very minor differences (only detectable on amplified differences) between avs, chainner using onnx and vs. pytorch in some cases, when settings are the same (e.g. tiles) . I think some of them might be due to the way it's converted to float or perhaps [0,1] clipping. The differences are so minor they are nothing to worry about

Thanks for testing, good to know that there are no big differences. That's the consensus I got from other places. When converting some models I get a warning "Backend: WARNING: The shape inference of prim::Constant type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function." but from what I read (https://github.com/ultralytics/yolov5/issues/6401), they are harmless.

Could be GPU memory ?

Did you try the tiling options ?

Probably, I need to experiment with those options.


Does anyone know of a good inpaint model? I only know 1x_NMKD-YandereInpaint_375000_G and 1x_sudo_inpaint_PartialConv2D_424000_G but not sure which one might be better for opaque logos on live action content.

1x_JPEG_60-80.pth can also be good for deblocking old codec sources, need to compare with 1x-Kim2091_DeJpeg.onnx.

I'll add those to the package.

Would like to see


4x_eula_digimanga_bw_v2_nc1_307k
MangaJPEG
1x_GainRESV3 (Aggro,Natural,Passive)
1x_DitherDeleter-Smooth_104000_G


Will do.

DTL
26th February 2023, 18:37
Can ask Asd-g about RIFE??

May be only RIFE developers https://arxiv.org/pdf/2011.06294v12.pdf understand how it is designed and how to change in into motion compensating engine based on reference frame. Not to interpolate between 2 given images.

Asd-g only make interface between RIFE engine and AVS+.

poisondeathray
26th February 2023, 18:41
Thanks for the thorough reply. I tried DPIR but had to downscale from uhd to 1280x720 for it to run and then it runs pretty fast but runs not at all above that resolution.


You can use "tiling" .

Look at the avsi for tilesize and overlap options. For spatial denoising like DPIR, if you use large enough overlap, the differences are usually undetectable to eye (except with amplified differences) between single tile (full image), vs. say 2x2 grid - many tests were done with the vapoursynth version in the past - I'm assuming the avs version is the same



Even if it is only "spatial" denoising it can be used before MSuper() spatialfilter.MSuper()
and then Mdegrain to "smooth" out the motion jitter.
Usually I do this with fft3dfilter and mdegrain but maybe there is some better way to stabilize the motion jitter/wobble caused by noise.


Not just for denoising; all single image operations are prone temporal inconsistencies. Another option is QTGMC in progressive mode but it has downsides too, even if you adjust the settings

It would be nice to have other options for temporal smoothing

DTL
26th February 2023, 18:58
The video SR/deblurring/denoising algos mentioned are multiframe bidirectional ...n-3, n-2, n-1, n, n+1, n+2, n+3... you can set 30, 50 or more frames if you wanted to

I haven't had a chance to look at it yet, but I'm not sure that RIFE would add much over for the mocomp over say mvtools2, and it would be slower

Do these algos mentioned have frame interpolation implementations (like framerate doubling, same as RIFE) so can also be tested for denoise performance/quality ?

The major issue of current motion compensation in mvtools is being limited to compensation of translate transform only. Also its motion estimation is not ideal because of noise (and noise can not be removed before motion estimation - it is 'egg and chicken' problem same as mentioned in that RIFE document).

So from the neural networks denoise (motion compensation for 'static' blending engines) expected:
1. Compensate for more real transforms (scale/rotate/skew/...)
2. To be less sensitive to natural noise in the sources to analyse (using variable size / variable shape areas to analyse in a big enough sequence of frames or better in total scene or even movie).

Current mvtools approach to decrease block size to have better and finer motion tracking also degrades its ability to correctly track noise-damaged blocks. So when signal-to-noise ratio come close to 1 or fall below 1 typical block-based motion search engines (also limited to 2 frames only) give very large errors and mostly useless.

So if in current quickly dying from degradation civilization we have very limited and dying programmers resources to design better motion search engines we try to look for 'hardware/machine learning' tools that can replace current poor programmers resources by 'brute force' of GBytes memory and TeraFlops+ accelerators and 'neural networks with ability to learn'. The performance is not very critical if it can provide significantly better quality in compare with current block-based simple motion search in mvtools. Some titles wait years and decades before being processed in yet another rip for release in possibly more or less better quality. So if it even will be processed several days/weeks/months it is not real physical problem.

poisondeathray
26th February 2023, 19:07
Do these algos mentioned have frame interpolation implementations (like framerate doubling, same as RIFE) so can also be tested for denoise performance/quality ?


VRT does; it's very very slow , and consumes large amounts of memory . It has 3 tiling , 3 overlap parameters, frame(temporal), height, width . (note that it's height first, not width)

https://github.com/JingyunLiang/VRT



The major issue of current motion compensation in mvtools is being limited to compensation of translate transform only. Also its motion estimation is not ideal because of noise (and noise can not be removed before motion estimation - it is 'egg and chicken' problem same as mentioned in that RIFE document).

Prefilter can sometimes help, but yes chicken vs. egg.

DTL
26th February 2023, 19:34
Prefilter can sometimes help, but yes chicken vs. egg.

Prefilter may degrade some valueable details for output. Also prefilter may increase motion search error. So I not like to use 'simple' prefilter before motion-compensated averaging.

"https://github.com/JingyunLiang/VRT"

It looks VRT still not have interface to Avisynth ? And can not be loaded via AviSynth+'s avs-mlrt plugin ?

poisondeathray
26th February 2023, 19:48
It looks VRT still not have interface to Avisynth ? And can not be loaded via AviSynth+'s avs-mlrt plugin ?

No avs interface, and cannot be loaded with avs-mlrt

Reel.Deel
27th February 2023, 00:05
Uploaded a handful of models that were requested here and also a few other's of Zarxrax's models (2x_LD-Anime_Compact_330k_net_g, 1x_Dotzilla_SuperUltraCompact_300k_net_g, 1x_Dotzilla_UltraCompact_182k_net_g).

@dogway, 1x_NMKD-YandereInpaint_375000_G is not available, do you have DL link?

Edit

https://www.mediafire.com/file/fp8gdb2a6ltdzra/NMKD+Yandere+Inpaint.7z/file

Thanks!

poisondeathray
27th February 2023, 00:10
1x_NMKD-YandereInpaint_375000_G is not available, do you have DL link?

https://www.mediafire.com/file/fp8gdb2a6ltdzra/NMKD+Yandere+Inpaint.7z/file

kedautinh12
27th February 2023, 02:05
I mention it because sometimes an earlier checkpoint produces better results. Here are all the checkpoints for DeGif that I have. Credits to NMKD (n00mkrad)
https://www.mediafire.com/file/2jzoqomhrt88bsk/NMKD+DeGIF.7z/file

Just curious :
1) how long does it take to convert ?
2) are results bit identical to the pytorch version?

can you convert it to onnx??

poisondeathray
27th February 2023, 02:15
can you convert it to onnx??

https://www.mediafire.com/file/51maete86cv48ib/2x_NMKD-DeGIF_210000_G_onnx.7z/file

kedautinh12
27th February 2023, 02:32
Thanks

Reel.Deel
27th February 2023, 02:52
Could be GPU memory ?

Did you try the tiling options ?


I was able to get it running using those options, although at a snails pace. I guess my GPU is not adequate for the bigger models (1050 now, I plan on upgrading to a 2070 in the upcoming months).

kedautinh12
27th February 2023, 05:22
All avs+ plugins collection by me, sort by architecture like Asd-g. @Reel.Deel i think you can sort like that for easy findout
https://drive.google.com/file/d/11Vk0HB58G7qVjKK0ZPRkemUnI1iAG71y/view?usp=drivesdk

anton_foy
27th February 2023, 09:16
You can use "tiling" .

Look at the avsi for tilesize and overlap options. For spatial denoising like DPIR, if you use large enough overlap, the differences are usually undetectable to eye (except with amplified differences) between single tile (full image), vs. say 2x2 grid - many tests were done with the vapoursynth version in the past - I'm assuming the avs version is the same




Not just for denoising; all single image operations are prone temporal inconsistencies. Another option is QTGMC in progressive mode but it has downsides too, even if you adjust the settings

It would be nice to have other options for temporal smoothing

Thanks! Yes tiling and overlap, I need to get back to my comp and try this, I had good results too with QTGMC's denoising in the past but it left some noise yet calmed down. Could you or someone convert 1x_ISO_denoise_v2? I would like to try all of the denoisers/degrainers in there but if that is too much I can try to convert them myself. Any link to the conversion software or does it cost?

Edit: thank you so much Reel.Deel great to see these kind of filters coming out for avs+!

Dogway
27th February 2023, 12:26
Thanks for the conversions Reel.Deel!
Maybe HiNet can be converted? It had really astonishing (https://forum.doom9.org/showthread.php?p=1964013#post1964013) results for scratches.
And just asking out of the blue, not sure if a film grain model as such exists, that is to add filmic grain, it can be an alternative to chickendream which is too slow. EDIT: yes, found 1x_Filmify4K_v2_325000_G but grain is not of great quality...
I also had 4x_Valar_v1 which is good for photo upscales it seems, but as with many of these it might require perfect artifact free downscaled content.

Also as a suggestion it might be interesting to try 2x_Waifaux-NL3-SuperLite_latest_G, as it might be a faster alternative to current solutions like w2xncnnvk.

EDIT: Tested 1x_JPEG_60-80 and 1x-Kim2091_DeJpeg and got a system freeze, black screen and AvsPmod crash. Well anyway I compared them to Oyster and they paled against it. Since Oyster is so slow, it would be interesting to train a model based on it with my script from this post (https://forum.doom9.org/showthread.php?p=1981849#post1981849) and probably a deblur model on it. Maybe if I have time in the future I can do such thing.

kedautinh12
27th February 2023, 13:37
About gain, maybe this model can help you "1x_Filmify4K_v2_325000_G"

Reel.Deel
27th February 2023, 15:39
Thanks for the conversions Reel.Deel!
Maybe HiNet can be converted? It had really astonishing (https://forum.doom9.org/showthread.php?p=1964013#post1964013) results for scratches.
And just asking out of the blue, not sure if a film grain model as such exists, that is to add filmic grain, it can be an alternative to chickendream which is too slow. EDIT: yes, found 1x_Filmify4K_v2_325000_G but grain is not of great quality...
I also had 4x_Valar_v1 which is good for photo upscales it seems, but as with many of these it might require perfect artifact free downscaled content.

Also as a suggestion it might be interesting to try 2x_Waifaux-NL3-SuperLite_latest_G, as it might be a faster alternative to current solutions like w2xncnnvk.


No problem, I will add your other suggestions (edit: added). And HiNet cannot be converted (at least in ChaiNNer, who knows if there are other methods).

EDIT: Tested 1x_JPEG_60-80 and 1x-Kim2091_DeJpeg and got a system freeze, black screen and AvsPmod crash. Well anyway I compared them to Oyster and they paled against it. Since Oyster is so slow, it would be interesting to train a model based on it with my script from this post (https://forum.doom9.org/showthread.php?p=1981849#post1981849) and probably a deblur model on it. Maybe if I have time in the future I can do such thing.

What were the dimensions of the image when trying 1x_JPEG_60-80 and 1x-Kim2091_DeJpeg? For me, I can't get most of the bigger models to run (black screen, driver crash) unless I use the tilesize and overlap options. With Kim2091_DeJpeg I had no trouble with but only used it on small picture. And I agree, I was not too impressed.

Training a model on Oyster does sound interesting. I read that Zarxrax used avs filters to train some of his models.

Could you or someone convert 1x_ISO_denoise_v2?
Done.

Dogway
27th February 2023, 16:14
The same image from the linked post, 472x400 pixels. I will try the tiling option. I mean my GPU is not THAT bad : ) TBH I'm waiting for an affordable +10Gb card, be it this gen or the next one, the xx70 sitting on 8Gb for 8 years is as ridiculous as the current prices.

poisondeathray
27th February 2023, 17:04
I had good results too with QTGMC's denoising in the past but it left some noise yet calmed down.


I wasn't referring to QTGMC for the purpose of denoising; I was referring to using single image filters on video such as 99% of the ones in that database - they can be prone to temporal inconsistencies. QTGMC inputtype=1 or 2 is one option that can be used after the single image filter(s) that can smooth over the consistencies, but as you know there are side effects to using QTGMC in progressive mode


Any link to the conversion software or does it cost?



chaiNNer is free. Reel.Deel posted instructions how to convert earlier.
https://github.com/chaiNNer-org/chaiNNer/releases

Reel.Deel
27th February 2023, 17:17
It's very easy to convert also. Load the required nodes, connect them and then hit run by either pressing the play button at the top or F5. Just make sure you've installed the dependencies.

https://i.ibb.co/6P4DDMg/chainner-convert.png

Side note for Win7 users like me. Alpha v0.17.1 is the last version that works and you have to place the api-ms-win-core-path-l1-1-0.dll (https://github.com/nalexandru/api-ms-win-core-path-HACK) in the Python folder which appears after the first time starting the program.

anton_foy
27th February 2023, 21:33
Thanks Reel.Deel!

Quote:
Originally Posted by anton_foy View Post
I had good results too with QTGMC's denoising in the past but it left some noise yet calmed down.
I wasn't referring to QTGMC for the purpose of denoising; I was referring to using single image filters on video such as 99% of the ones in that database - they can be prone to temporal inconsistencies. QTGMC inputtype=1 or 2 is one option that can be used after the single image filter(s) that can smooth over the consistencies, but as you know there are side effects to using QTGMC in progressive mode

Quote:
Any link to the conversion software or does it cost?

chaiNNer is free. Reel.Deel posted instructions how to convert earlier.
https://github.com/chaiNNer-org/chaiNNer/releases

Aah okay I had too little knowledge of QTGMC I did not know about this mode. Thanks for the link, I will use it!

DTL
9th March 2023, 10:58
Prefilter can sometimes help, but yes chicken vs. egg.

Finally iterative solution for chicken and egg problem in motion compensating denoising - https://forum.doom9.org/showthread.php?p=1984152#post1984152

Now I think if it possible to replace either MAnalyse or MDegrain in that solution with some neural network processing from existing but keeping the iterative idea of checking each generation result with non-distorted input source.

In each iteration the algorithm refines both denoised clip and MVs field. But there is no current NN plugins capable of return MVs field in compatible with mvtools format ?

May be instead of MDegrain create an interleaved clip with MCompensated frames from input MVclip for each iteration and pass it to RIFE denoise ?

Reel.Deel
18th March 2023, 20:53
I'll respond here to not hijack Selur's thead (https://forum.doom9.org/showthread.php?t=184797).


No error message ? Just "hangs" ?

Yet other onnx conversions work ok on that same avs setup ?

Did you check that other applications which might be using GPU are closed ?

I closed everything, except VDub2 and it just hangs. I let it run for about 5 minuted and nothing. It says not responding and shows this:

Description:
A problem caused this program to stop interacting with Windows.

Problem signature:
Problem Event Name: AppHangB1
Application Name: VirtualDub64.exe
Application Version: 2.0.0.0
Application Timestamp: 5e73f48a
Hang Signature: 315e
Hang Type: 0
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
Additional Hang Signature 1: 315e1db675843581067ed78f1c415427
Additional Hang Signature 2: 4ae5
Additional Hang Signature 3: 4ae5c6bd4a564e63c8d65dcb154a1aa2
Additional Hang Signature 4: 315e
Additional Hang Signature 5: 315e1db675843581067ed78f1c415427
Additional Hang Signature 6: 4ae5
Additional Hang Signature 7: 4ae5c6bd4a564e63c8d65dcb154a1aa2



I have not tried many models but all of Zarxrax's models work fine and also 1x_SwatKatsLite_360000_G.

Edit: It works now due to something very odd, this is my script:

FFVideoSource("HT1-1-RainbowsSample.m2v") # NTSC DVD
TFM(PP=0)
TDecimate()
ConvertToPlanarRGB()
o = last
ConvertBits(32)
mlrt_ncnn(network_path="...\2x_AnimeClassics_UltraLite_510K.onnx", builtin=false, tilesize_w=width/4, tilesize_h=height/4, overlap_w=8, overlap_h=8)
ConvertBits(8)
#Interleave(o,last)

When Interleave(o,last) is not commented out, it just hangs :confused:

StvG
19th March 2023, 06:09
FFVideoSource("HT1-1-RainbowsSample.m2v") # NTSC DVD
TFM(PP=0)
TDecimate()
ConvertToPlanarRGB()
o = last
ConvertBits(32)
mlrt_ncnn(network_path="...\2x_AnimeClassics_UltraLite_510K.onnx", builtin=false, tilesize_w=width/4, tilesize_h=height/4, overlap_w=8, overlap_h=8)
ConvertBits(8)
#Interleave(o,last)

When Interleave(o,last) is not commented out, it just hangs :confused:

"o" and "last" have different dimensions.

Selur
19th March 2023, 08:25
"o" and "last" have different dimensions.
I agree, but it should complain about that and not crash,...