Asd-g / avs-mlrt

ML Runtimes for AviSynth+.
GNU General Public License v3.0
19 stars 0 forks source link

Clip must have video #8

Closed kedaitinh12 closed 10 months ago

kedaitinh12 commented 10 months ago

I got that error when I tried to use avs-mlrt with dpir models

Script: LoadPlugin("C:\Megui\MeGUI-2944-64\tools\lsmash\LSMASHSource.dll") LWLibavVideoSource("C:\Users\ADMIN\Downloads\aa.mkv") z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:l=>rgb:709:709:f") mlrt_ncnn(network_path="C:/Program Files (x86)/AviSynth+/plugins64+/models/dpir/drunet_deblocking_color.onnx", builtin=false, fp16=true, tilesize_w=width/4, tilesize_h=height/4, overlap_w=8, overlap_h=8) z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:709:709:f=>709:709:709:l")

Sample: https://forum.doom9.org/showthread.php?p=1993627#post1993627

Models: https://github.com/styler00dollar/VSGAN-tensorrt-docker/releases/tag/models image

Asd-g commented 10 months ago

Both tilesize_w and tilesize_h must be divisible by 8 for this model.

If you use mlrt_DPIR(model=3) you will get error about the tilesize.

kedaitinh12 commented 10 months ago

mlrt_DPIR(model=3)

mlrt_DPIR(model=3) is working but the result doesn't look like here: https://imgsli.com/MjE5Mzcw

My result: New File001336_2

Script: LoadPlugin("C:\Megui\MeGUI-2944-64\tools\lsmash\LSMASHSource.dll") LWLibavVideoSource("C:\Users\ADMIN\Downloads\aa.mkv") z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:l=>rgb:709:709:f") mlrt_DPIR(model=3) z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:709:709:f=>709:709:709:l") converttoyuv444() MSRCP

Asd-g commented 10 months ago

What's the script for the first image?

kedaitinh12 commented 10 months ago

He only use with default settings https://forum.doom9.org/showthread.php?p=1993694#post1993694

kedaitinh12 commented 10 months ago

He just add script in link above but i can't make script working with strength=50

Asd-g commented 10 months ago

I have no issues with strength=50. Try with tiles/tilesize.

kedaitinh12 commented 10 months ago

I have no issues with strength=50. Try with tiles/tilesize.

What value tiles/tilesize you set??

kedaitinh12 commented 10 months ago

I tried with this script but result same with mlrt_DPIR(model=3) LWLibavVideoSource("C:\Users\ADMIN\Downloads\aa.mkv") z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:l=>rgb:709:709:f") mlrt_DPIR(model=3, strength=50, tiles=8, tilesize=8) z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:709:709:f=>709:709:709:l") converttoyuv444() MSRCP

btw, can you add parameter device_id to mlrt,avsi all functions?? My machine always chooses AMD onboard card over NVIDIA discrete graphics cards

Asd-g commented 10 months ago

I didn't set tiles/tilesize. This is what I tried:

FFVideoSource("aa.mkv")
z_ConvertFormat(pixel_type="rgbps", colorspace_op="709:709:709:f=>rgb:709:709:f")
mlrt_DPIR(model=3, strength=50)
z_ConvertFormat(pixel_type="rgbp16")
MSRCP(sigma=[25,80,250], fulls=False, fulld=False)
z_ConvertFormat(pixel_type="yuv420p10", colorspace_op="rgb:709:709:l=>709:709:709:l")

You can try mlrt_DPIR(model=3, strength=50, tiles=2).

To choose GPU: mlrt_DPIR(model=3, strength=50, tiles=2, backend=["ncnn", "device_id=X"]) where x is the number of the GPU. You can use mlrt_DPIR(model=3, strength=50, tiles=2, backend=["ncnn", "list_gpu=true"]) to see the available GPUs.

kedaitinh12 commented 10 months ago

ok, it work and result look ok with tiles=2, thanks