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.

Deoldify Vapoursynth filter
Using:
# changing color matrix from '470bg' to '709' for vsDeOldify
clip = core.resize.Bicubic(clip, matrix_in_s="470bg", matrix_s="709")
# changing range from limited to full range for vsDeOldify
clip = core.resize.Bicubic(clip, range_in_s="limited", range_s="full")
# setting color range to PC (full) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_FULL)
# adjusting color space from YUV420P8 to RGB24 for vsDeOldify
clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="709", range_s="full")
# adding colors using DeOldify
# loading reference clip for Remaster
clipRef = HAVC_read_video(source="G:/TestClips&Co/files/test_ref.avi", fpsnum=clip.fps_num, fpsden=clip.fps_den)
clip = HAVC_restore_video(clip=clip, clip_ref=clipRef, ex_model=2, ref_merge=0, max_memory_frames=0)
# internally changing color matrix for YUV<>RGB to '470bg' undoing color matrix change for vsDeOldify
# changing range from full to limited range for vsDeOldify
clip = core.resize.Bicubic(clip, range_in_s="full", range_s="limited")
I get:
Failed to evaluate the script:
Python exception: SetFrameProp: one of 'intval', 'floatval', or 'data' must be passed->

Traceback (most recent call last):
File "src\\cython\\vapoursynth.pyx", line 3387, in vapoursynth._vpy_evaluate
File "src\\cython\\vapoursynth.pyx", line 3388, in vapoursynth._vpy_evaluate
File "J:\tmp\tempPreviewVapoursynthFile20_26_11_983.vpy", line 48, in
clip = HAVC_restore_video(clip=clip, clip_ref=clipRef, ex_model=2, ref_merge=0, max_memory_frames=0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vsdeoldify\__init__.py", line 831, in HAVC_restore_video
clip_ref = SceneDetect(clip_ref, threshold=ref_thresh, frequency=ref_freq)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vsdeoldify\vsslib\vsscdect.py", line 46, in SceneDetect
clip = clip.std.SetFrameProp(prop="sc_threshold", floatval=threshold)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "src\\cython\\vapoursynth.pyx", line 3123, in vapoursynth.Function.__call__
vapoursynth.Error: SetFrameProp: one of 'intval', 'floatval', or 'data' must be passed->
(updated Hybrid_deoldify)

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
I was expecting that the threshold and frequency to be provided in input.
Released new RC5 where now I manage the situation where  threshold and frequency are both missing.
Included also a test sample using the avi format.

Dan


Attached Files
.zip   vsdeoldify-5.0.0_RC5.zip (Size: 424,65 KB / Downloads: 5)
.zip   Test_HAVC_restore_video.zip (Size: 1,42 MB / Downloads: 10)
Reply
will look at it tomorrow
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
Before looking into implementing the code for the FilterQueue.

Let's go through each of the functions:
(Aside note: if the values are the default value, they might not be set either.)

HAVC_restore_video
Is it correct, that:
  • ref_merge should only be set if "ex_model != 2 && ex_model != 5" ?
  • ref_weight and ref_freq should only be set if ref_merge > 0 ( and "ex_model != 2 && ex_model != 5")?
  • max_memory_frames should only be set for ex_model "ColorMNet" and "Deep-Remaster" ?
  • encode_mode is only set for ex_model "ColorMNet"?
?

HAVC_deepex
Is it correct, that:
  • ref_merge should only be set if "ex_model != 2 && ex_model != 5" ?
  • ref_weight and ref_freq should only be set if ref_merge > 0 ( and "ex_model != 2 && ex_model != 5")?
  • max_memory_frames should only be set for ex_model "ColorMNet" and "Deep-Remaster" ?
  • encode_mode is only set for ex_model "ColorMNet"?
?


HAVC_DeepRemaster
Is it correct, that:
  • ref_dir is always set to either None or the current sc_framedir value
  • there are no rules when to set ref_minedge, frame_mindim, ref_buffer_size, inference_mode, mode
?

HAVC_ddeoldify
Is it correct, that:
  • HAVC_ddeoldify is always assigned to clipRef when deepEx is used.
  • deoldify_p is only used when method != 1
  • ddcolor_p is only used when method != 0
  • ddtweak is only used when method != 0
  • ddtweak_p is only used when method != 0 and ddtweak = true
  • cmc_tresh is only used when method = 3
  • lmm_p is only used when method = 4
  • alm_p is only used when method = 5
  • cmb_sw is only used when method > 1
  • sc_threshold, sc_tht_offset, sc_min_freq, sc_min_int, sc_tht_ssim, sc_normalize are only used when deepEx is used
?

Cu Selur

Ps.: updated Hybrid_deoldify
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
The HAVC filters are able to use the necessary parameters to perform the selected action. 

I think that ithe simpler approach is to provide to the called functions the parameters available on the  GUI.

Please find below the answers to your questions:

HAVC_restore_video
Is it correct, that:
  • ref_merge should only be set if "ex_model != 2 && ex_model != 5" :
    ref_merge cannot be set if method == 2. The ref_merge cannot be used if the reference frames are different from the source video. The method == 2 is the only one that states explicitly that the RF are different from video. But now the thing are still more complex. So this is my proposal:
  1. Restrict the list of available methods to: 0 = HAVC simple, 1 = HAVC + external RF,  2 = external RF only,  3 = HAVC video restore
  2. add a check box in the GUI, near ref_merge, with the name "RF same as video" (you could replace in GUI sc_debug that is not used)
  3. otherwise is necessary to extend the list of available methods as: 0 = HAVC same as video (default), 1 = HAVC + RF same as video,  2 = HAVC + RF different from video, 3 = external RF same as video,  4 = external RF different from video,  5 = HAVC restore same as video, 6 = HAVC restore different from video
  • ref_weight and ref_freq should only be set if ref_merge > 0 ( and "ex_model != 2 && ex_model != 5")?  ref_merge and ref_freq must always provided, they can be initialized with the following logic:    
  1. if ref_merge > 0:  sc_min_freq = 1  (-> HAVC_ddeoldify),  sc_min_freq = GUI value (-> HAVC_deepex, HAVC_restore_video)   
  2. if sc_min_freq > 1:  ref_freq = GUI value ,  else:  ref_freq = 0 (the functions will assign eventually a default value if necessary)
  3. if  0 < sc_threshold < 1:  ref_tresh = sc_threshold, else: ref_tresh = 0.10
  • max_memory_frames should only be set for ex_model "ColorMNet" and "Deep-Remaster" ? YES

  • encode_mode is only set for ex_model "ColorMNet"? YES



HAVC_deepex
Is it correct, that:
  • ref_merge should only be set if "ex_model != 2 && ex_model != 5" ? see explanation above. It will depends on what solution you prefer to adopt

  • ref_weight and ref_freq should only be set if ref_merge > 0 ( and "ex_model != 2 && ex_model != 5")? see explanation above

  • max_memory_frames should only be set for ex_model "ColorMNet" and "Deep-Remaster" ? YES

  • encode_mode is only set for ex_model "ColorMNet"? YES




HAVC_DeepRemaster
This function has been added for internal use only. It is called only if method in (3, 4) and ex_model = 2. This version of DeepRemaster is able to read directly the images folder (mode=0) and should be a little faster respect to the version the include the external ref images in a video clip.

HAVC_ddeoldify
Is it correct, that:
  • HAVC_ddeoldify is always assigned to clipRef when deepEx is used. When DeepEX is enabled in the GUI and method in (0,1,2)

  • deoldify_p is only used when method != 1 YES

  • ddcolor_p is only used when method != 0 YES

  • ddtweak is only used when method != 0 YES

  • ddtweak_p is only used when method != 0 and ddtweak = true YES

  • cmc_tresh is only used when method = 3 YES

  • lmm_p is only used when method = 4 YES

  • alm_p is only used when method = 5 YES

  • cmb_sw is only used when method > 1 YES

  • sc_threshold, sc_tht_offset, sc_min_freq, sc_min_int, sc_tht_ssim, sc_normalize are only used when deepEx is used YES

I started to test the last dev version but there are some issues that has been addressed only in this post. Moreover is necessary to decided how to name the method 5, depending on your choice to add a check box or to extended the number of exemplar-based methods. In any case it will be necessary to realease a new RC. 

Thanks,
Dan
Reply
Okay, 'custom'-mode is gone again.
=> I'll delete all the code related to 'custom' now and simplify the gui accordingly.
I might add a 'custom' option back when it's not a constantly changing target at some later point in time.

Quote:HAVC_ddeoldify is always assigned to clipRef when deepEx is used. When DeepEX is enabled in the GUI and method in (0,1,2)
Are you referring to 'Combine Method' or 'Exemplar Models->Method' ?

Cu Selur

Ps.: While at it, I'll also rename the whole filter and variables to HAVC in Hybrid
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
I don't understand what was gone in custom mode, and what was changed recently for you.

As wrote previously custom mode was working with the only exception of method = 5.

Regarding the method = 5, I can apply a merge only if the reference frames are the same as video. If they are different, the merge is still possible but the result will be very bad. 
So I need to know when the reference frames are the same as video also for the method = 5.
To do that are available 2 options:

1) extended the list of exemplar-based methods in:

0 = HAVC same as video (default)
1 = HAVC + RF same as video
2 = HAVC + RF different from video
3 = external RF same as video
4 = external RF different from video
5 = HAVC restore same as video
6 = HAVC restore different from video

2) It also possible to simplify the list in:

0 = HAVC simple
1 = HAVC + external RF
2 = external RF only
3 = HAVC video restore

and to add a check box in the GUI, near ref_merge, with the name "RF same as video" (you could replace in GUI sc_debug that is not used) to let me know if the ref_merge can be applied.

Please let me know what of 2 options do you prefer.

Regarding your question: HAVC_ddeoldify is always assigned to clipRef when deepEx is used
The answer is: when is enabled the check box "Exemplar Models" and method in: 

0 = HAVC same as video (default)
1 = HAVC + RF same as video
2 = HAVC + RF different from video

Dan
Reply
Custom is dropped, no need to talk about it anymore.
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
But the exemplar methods:

0 = HAVC same as video (default)
1 = HAVC + RF same as video
2 = HAVC + RF different from video
3 = external RF same as video
4 = external RF different from video
5 = HAVC restore same as video           [new]
6 = HAVC restore different from video   [new]

Are not part of custom, I will release the new RC the list of methods extended to 7 items (0-6).

Dan
Reply
Yes, and I will apply non-custom at some time.
Atm. I'm busy renaming variables and deleting a few thousand lines of code.
Once stuff compiles again, I will try to adjust things so that non-custom works.
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)