This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

DeepEnhancer
#31
Strange, it worked fine here.
I tried in vsViewer and then in Hybrid (FeMasSR+BasicVSR++).
I did not try loading the script as a source in Hybrid. (Will try that tomorrow)
You added this before loading any torch related stuff, right?
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#32
(Yesterday, 20:12)Selur Wrote: Strange, it worked fine here.
I tried in vsViewer and then in Hybrid (FeMasSR+BasicVSR++).
I did not try loading the script as a source in Hybrid. (Will try that tomorrow)
You added this before loading any torch related stuff, right?

Yes, I added the statements at the beginning of the script.

I attached the script used.

Dan


Attached Files
.zip   Test-BasicVSR+FeMaSR (2).zip (Size: 1,61 KB / Downloads: 6)
Reply
#33
Hmm,... something is 'off' there.
[Image: grafik.png]
Your script, just froze for me in the preview. No gpu usage, just 4% cpu.
I don't see any outputs now, but my guess is that FeMaSR once again doesn't work with TRT anymore.
Really strange seeing the taskmgr indication 0% GPU usage and at the same time indicating 28.6% GPU usage for Vapoursynth. (with 3 streams it indicates 64.5%)

Using:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import logging
import sys
import os
core = vs.core
# Import scripts folder
scriptPath = 'F:/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Force logging to std:err
#logging.StreamHandler(sys.stderr)
# loading plugins
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll")
# Import scripts
import validate
# Source: 'G:\TestClips&Co\files\test.avi'
# Current color space: YUV420P8, bit depth: 8, resolution: 640x352, frame rate: 25fps, scanorder: progressive, yuv luminance scale: limited, matrix: 470bg, format: MPEG-4 Visual
# Loading G:\TestClips&Co\files\test.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="G:/TestClips&Co/files/test.avi", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0)
frame = clip.get_frame(0)
# setting color matrix to 470bg.
clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT470_BG)
# setting color transfer (vs.TRANSFER_BT601), if it is not set.
if validate.transferIsInvalid(clip):
  clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT601)
# setting color primaries info (to vs.PRIMARIES_BT470_BG), if it is not set.
if validate.primariesIsInvalid(clip):
  clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT470_BG)
# setting color range to TV (limited) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
# making sure frame rate is set to 25fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# making sure the detected scan type is set (detected: progressive)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
# adjusting color space from YUV420P8 to RGBH for vsBasicVSRPPFilter
clip = core.resize.Bicubic(clip=clip, format=vs.RGBH, matrix_in_s="470bg", range_s="limited")
# Quality enhancement using BasicVSR++
from vsbasicvsrpp import basicvsrpp as BasicVSRPP
clip = BasicVSRPP(clip=clip, model=4)
from vsfemasr import femasr as FeMaSR
# adjusting color space from RGBH to RGBS for vsFeMaSR
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, range_s="limited")
# resizing using FeMaSR
clip = FeMaSR(clip=clip, device_index=0, trt=True, trt_cache_dir=r"J:\tmp", trt_workspace_size=1073741824, num_streams=3) # 1280x704
# adjusting output color from: RGBS to YUV420P10 for NVEncModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="470bg", range_s="limited", dither_type="error_diffusion")
# set output frame rate to 25fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# output
clip.set_output()
I get an output, but that output is broken:
[Image: grafik.png]
=> really seems like FeMaSR is broken once again with TRT.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#34
The warnings from basicvsrpp, should not be the issue, since warnings get send to std:err
https://docs.python.org/3/library/warnings.html
Yes, those are sent to stderr. (see attachment)
Maybe adding
logging.captureWarnings(False)
will make a difference.


Attached Files
.zip   normal.zip (Size: 40,34 KB / Downloads: 5)
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#35
On my side the script is working.
The first time to generate the trt file "FeMaSR_SRX2_model_g.pth_672x480_fp16_NVIDIA GeForce RTX 5070 Ti_trt-10.9.0.34.ep" it took a lot of time (5min-10min).
But after the cache generation the encoding speed is quite good.

Dan
Reply
#36
Will try to do some testing tomorrow.
Should be asleep for a while
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#37
Hi Dan,
Thank you so much for the sample and script—the result is really impressive! FeMaSR delivers excellent sharpness and detail, and I can definitely see its potential in restoration workflows.
I really appreciate the encoding tips for Hybrid with NVEnc and DirectSynthLoading enabled. It worked perfectly on my end.
Thanks again for your continuous support and for sharing all these powerful tools with us!
Best regards,
Reply
#38
(Yesterday, 21:41)Selur Wrote: Will try to do some testing tomorrow.
Should be asleep for a while

I tested your script with the same clip (Downfall_of_Hitler.avi) and I get your results, so it seems that FeMaSR is broken...

Dan
Reply
#39
Have you tried dumping the raw output of vspipe into a file to see what data ends up in it? => didn't see anything.
When exporting to test.y4m (and not piping) the output seems fine.
So the problems seems to be related to the pipe, but without knowing that info is ending up in the pipe that should not be there, I have no clue how to work around it.
=> I will probably have to disable the TRT for FeMaSR.
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#40
adding:
os.environ['TLLM_LOG_LEVEL'] = 'error'
to the script seems to fix the problem (see https://github.com/vapoursynth/vapoursynth/issues/1120)
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)