Community
Arnold for Maya Forum
Rendering with Arnold in Maya using the MtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Noice command line for EXR sequence on Mac

7 REPLIES 7
Reply
Message 1 of 8
tsines
348 Views, 7 Replies

Noice command line for EXR sequence on Mac

I am trying to do a demo for my students at Pratt to run Noice for Denoising their image sequences for their senior projects. Unfortunately the students have to use "Render Sequence" instead of command line batch rendering because Autodesk has not licensed standalone Arnold for the school, which results in watermarks. 

So to circumvent this, they are rendering with the Arnold default settings, with some AOV modifications; exporting the following AOVs: RGBA, Depth, N_Noice, Albedo, Coat, Coat_Albedo, Coat_Direct, Coat_Indirect, Denoise_Albeco_Noice, Diffuse, Diffuse_Albedo, Diffuse_Direct, Diffuse_Indirect, Motionvector, Shadow, Shadow_Mask, Shadow_Diff, Shadow_Matte, Specular, Specular_Albedo, Specular_Direct, Specular_Indirect, SSS, SSS_Albedo, SSS_Indirect, SSS_Direct.
Scene_layerContactSheetScene_layerContactSheet
We would ideally like an exact denoised clone of the original .exr, but when doing it standalone (one frame at a time) I had to add the -l AOV-flags for each AOV, which is beyond tedious. Additionally, noice gives the following errors:

% /Applications/Autodesk/Arnold/mtoa/2022/bin/noice -i /Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest/ShadowTest.0001.exr -o /Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest_DN/ShadowTestDN.0001.exr -pr 4 -l specular -l motionvector -l z -l sss -l sss_direct -l sss_indirect

noice 7.1.1.0 [eba1345a] - the Arnold denoiser

Loading images...

Loading file "/Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest/ShadowTest.0001.exr".

Using feature AOV 'denoise_albedo' with filter 'gaussian_filter'

Using feature AOV 'N' with filter 'gaussian_filter'

Using feature AOV 'Z' with filter 'gaussian_filter'

Working with 1 frame at 1920x1080

Will denoise AOV "RGBA", using associated variance

   Output file will be "/Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest_DN/ShadowTestDN.0001.exr"

Will just copy AOV "motionvector", variance not found

   Output file will be "/Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest_DN/ShadowTestDN.0001.exr"

Will just copy AOV "specular", variance not found

   Output file will be "/Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest_DN/ShadowTestDN.0001.exr"

Will just copy AOV "sss", variance not found

   Output file will be "/Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest_DN/ShadowTestDN.0001.exr"

Will just copy AOV "sss_direct", variance not found

   Output file will be "/Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest_DN/ShadowTestDN.0001.exr"

Will just copy AOV "sss_indirect", variance not found

   Output file will be "/Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest_DN/ShadowTestDN.0001.exr"

   Could not find AOV with source z

Could not find AOV "z" to denoise, skipping.

Start denoising (patch radius 4, search radius 9, variance 0.5)

Denoising RGBA

Denoising motionvector

   Could not find AOV with source motionvector and filter variance_filter

   Could not find variance for AOV "motionvector", skipping denoise.

Denoising specular

   Could not find AOV with source specular and filter variance_filter

   Could not find variance for AOV "specular", skipping denoise.

Denoising sss

   Could not find AOV with source sss and filter variance_filter

   Could not find variance for AOV "sss", skipping denoise.

Denoising sss_direct

   Could not find AOV with source sss_direct and filter variance_filter

   Could not find variance for AOV "sss_direct", skipping denoise.

Denoising sss_indirect

   Could not find AOV with source sss_indirect and filter variance_filter

   Could not find variance for AOV "sss_indirect", skipping denoise.

Finished denoising

Saving image /Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest_DN/ShadowTestDN.0001.exr (1920 x 1080 x 19)

I set all of my filters to variance, except for RGBA, N, Z, and denoise_albedo, and they still are ignored by Noice.


As for using Noice on a sequence, I am really striking out. I read these threads:
https://forums.autodesk.com/t5/maxtoa-forum/denoice-exe-animation-batch-script-v0-1-for-3ds-max-down...

https://forums.autodesk.com/t5/arnold-forum/noice-won-t-process-full-sequence/m-p/11040670
https://forums.autodesk.com/t5/mtoa-forum/how-to-denoise-image-sequence-through-noice-standalone-in-...

Theoretically the process in Linux should be the same, or similar, for Mac.


So I tried modifying the script mentioned here
https://github.com/zpelgrims/noice_command_generation/blob/master/noice_command_generation.py
in a text editor and keep getting SyntaxErrors no matter what I do:

 

import re

# only change these variables
filename_input = "/Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest/ShadowTest.####.exr"
filename_output = "/Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest_DN/ShadowTestDN.####.exr"
arnold_bin_path = "/Applications/Autodesk/Arnold/mtoa/2022/bin"
startframe = 1
endframe = 40
variance = 0.5
pixel_search_radius = 9
pixel_neighborhood_patch_radius = 3
temporal_range = 6
light_aov_names = ["frontlight", "backlight"] # if no light aov denoising needed, just leave list empty: []

 

filename_input_sequence_number = re.sub(r'#+',lambda m: r'{{:0{}d}}'.format(len(m.group(0))), filename_input)
filename_output_sequence_number = re.sub(r'#+',lambda m: r'{{:0{}d}}'.format(len(m.group(0))), filename_output)

for i in range (startframe, endframe + 1):
temporal_range_string = ""
light_aov_string = ""
for j in range(-temporal_range/2, temporal_range/2):
if (j==0) or (i+j < startframe) or (i+j > endframe):
continue

temporal_range_string += "-i " + filename_input_sequence_number.format(i+j) + " "

for k in light_aov_names:
light_aov_string += "-aov " + str(k) + " "

print (arnold_bin_path + "/noice"
+ "-patchradius " + str(pixel_neighborhood_patch_radius) + " " \
+ "-searchradius " + str(pixel_search_radius) + " " \
+ "-variance " + str(variance) + " " \
+ light_aov_string + " " \
+ "-i " + filename_input_sequence_number.format(i) + " " \
+ temporal_range_string + " " \
+ "-output " + filename_output_sequence_number.format(i))

if i is not endframe:
print " &&",

 

I tried to put the print (arnold_bin_path on one which resulted in the following error:

SyntaxError: Missing parentheses in call to 'print'. Did you mean print(" &&", end=" ")?

(base) sines@scaleMP ~ % python noice_command_generation.py

Traceback (most recent call last):

  File "noice_command_generation.py", line 23, in <module>

    for j in range(-temporal_range/2, temporal_range/2):

TypeError: 'float' object cannot be interpreted as an integer


At this point I'm not sure what to modify next as I am a full-on Python noob and can't find a solution with just randomly adding parentheses. 

 

Curious as to how do I use the Denoise imager flags for a Mac without Optix? It's a shame I have 16GB of GPUs doing absolutely nothing right now. We tried Denoising in Nuke and it looks like pastel garbage; so Noice is our only choice to denoise.

Hoping to solve this soon. Thanks in advance for your help!

 

Labels (3)
7 REPLIES 7
Message 2 of 8
Stephen.Blair
in reply to: tsines

So you set up all the AOVs with two drivers, as shown here ?

https://arnoldsupport.com/2021/03/22/mtoa-denoising-aovs-with-the-arnold-denoiser/

 

These messages say that there's no variance AOV for specular:

 

Denoising specular

   Could not find AOV with source specular and filter variance_filter

   Could not find variance for AOV "specular", skipping denoise.

 

 



// Stephen Blair
// Arnold Renderer Support
Message 3 of 8
tsines
in reply to: Stephen.Blair

@Stephen.Blair no, I wasn't aware it took 2 drivers per AOV. I will reconfigure and try again. Thank you.

Any ideas on a Python script to run Noice on all of the merged AOVs on all of the EXRs in an image sequence? Processing 1 EXR at a time is pretty tiresome.

Message 4 of 8
Stephen.Blair
in reply to: tsines

If you wanted that Python you posted to work, do this:

    test = arnold_bin_path + "/noice.exe " \
            + "-patchradius " + str(pixel_neighborhood_patch_radius) + " " \
            + "-searchradius " + str(pixel_search_radius) + " " \
            + "-variance " + str(variance) + " " \
            + light_aov_string + " " \
            + "-i " + filename_input_sequence_number.format(i) + " " \
            + temporal_range_string + " " \
            + "-output " + filename_output_sequence_number.format(i),

    print( test )

 

 



// Stephen Blair
// Arnold Renderer Support
Message 5 of 8
tsines
in reply to: tsines

This is my revised script [got rid of all of the \ so that it would be read on one line]
Reminding you that I am on a Mac, so I have removed "/noice.exe" and replaced it with "/noice"

 

import re

# only change these variables
filename_input = "/Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest/ShadowTest.####.exr"
filename_output = "/Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest_DN/ShadowTestDN.####.exr"
arnold_bin_path = "/Applications/Autodesk/Arnold/mtoa/2022/bin"
startframe = 1
endframe = 40
variance = 0.5
pixel_search_radius = 9
pixel_neighborhood_patch_radius = 3
temporal_range = 6
light_aov_names = ["frontlight", "backlight"] # if no light aov denoising needed, just leave list empty: []

 

filename_input_sequence_number = re.sub(r'#+',lambda m: r'{{:0{}d}}'.format(len(m.group(0))), filename_input)
filename_output_sequence_number = re.sub(r'#+',lambda m: r'{{:0{}d}}'.format(len(m.group(0))), filename_output)

for i in range (startframe, endframe + 1):
temporal_range_string = ""
light_aov_string = ""
for j in range(-temporal_range/2, temporal_range/2):
if (j==0) or (i+j < startframe) or (i+j > endframe):
continue

temporal_range_string += "-i " + filename_input_sequence_number.format(i+j) + " "

for k in light_aov_names:
light_aov_string += "-aov " + str(k) + " "

test = arnold_bin_path + "/noice" + "-patchradius " + str(pixel_neighborhood_patch_radius) + " " + "-searchradius " + str(pixel_search_radius) + " " + "-variance " + str(variance) + " " + light_aov_string + " " + "-i " + filename_input_sequence_number.format(i) + " " + temporal_range_string + " " + "-output " + filename_output_sequence_number.format(i),

print( test )

 

Getting the following.

(base) sines@scaleMP ~ % python3 /Users/sines/noice_command_generation.py 

  File "/Users/sines/noice_command_generation.py", line 32

    test = arnold_bin_path + "/noice" \

                                      ^

IndentationError: unindent does not match any outer indentation level

(base) sines@scaleMP ~ % python3 /Users/sines/noice_command_generation.py

  File "/Users/sines/noice_command_generation.py", line 32

    test = arnold_bin_path + "/noice" + "-patchradius " + str(pixel_neighborhood_patch_radius) + " " + "-searchradius " + str(pixel_search_radius) + " " + "-variance " + str(variance) + " " + light_aov_string + " " + "-i " + filename_input_sequence_number.format(i) + " " + temporal_range_string + " " + "-output " + filename_output_sequence_number.format(i),

                                                                                                                                                                                                                                                                                                                                                                      ^

IndentationError: unindent does not match any outer indentation level

Message 6 of 8

I've reformatted your script to make it more readable on here, I think you had a trailing '\' at the end that was causing the unindentation error

 

import re

# only change these variables
filename_input = "/Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest/ShadowTest.####.exr"
filename_output = "/Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest_DN/ShadowTestDN.####.exr"
arnold_bin_path = "/Applications/Autodesk/Arnold/mtoa/2022/bin"
startframe = 1
endframe = 40
variance = 0.5
pixel_search_radius = 9
pixel_neighborhood_patch_radius = 3
temporal_range = 6
light_aov_names = ["frontlight", "backlight"] # if no light aov denoising needed, just leave list empty: []

 

filename_input_sequence_number = re.sub(r'#+',lambda m: r'{{:0{}d}}'.format(len(m.group(0))), filename_input)
filename_output_sequence_number = re.sub(r'#+',lambda m: r'{{:0{}d}}'.format(len(m.group(0))), filename_output)

for i in range (startframe, endframe + 1):
    temporal_range_string = ""
    light_aov_string = ""
    for j in range(int(-temporal_range/2), int(temporal_range/2)):
        if (j==0) or (i+j < startframe) or (i+j > endframe):
            continue

        temporal_range_string += "-i " + filename_input_sequence_number.format(i+j) + " "

    for k in light_aov_names:
        light_aov_string += "-aov " + str(k) + " "

    test = arnold_bin_path + "/noice" 
    test += " -patchradius " + str(pixel_neighborhood_patch_radius) 
    test += " -searchradius " + str(pixel_search_radius) 
    test += " -variance " + str(variance) + " " + light_aov_string 
    test += " -i " + filename_input_sequence_number.format(i) 
    test += " " + temporal_range_string 
    test += "-output " + filename_output_sequence_number.format(i)

    print( test, )
    
    if i is not endframe:
      print(" &&",)

 

 



Ashley Handscomb Retallack
Senior Software Engineer (Arnold)
Arnold Documentation | Arnold Downloads
Message 7 of 8
tsines
in reply to: tsines

@ashley.handscomb.retallack I tried the above, and all it doesn't give me an error, but instead, its print every frame's theoretical output, but doesn't actually start Noice. I imagine that is bevause of the word "test" but I want to actually pull the trigger and process my frame sequence.

Since I have a ton of merged AOVs (diffuse, motionvector, shadow_matte, sss, specular, *_indirects, and so on) to process per frame, how would I automatically run Noice on these frames without having to list each and every AOV? And where would I list them? Typically noice looks for this string:

/Applications/Autodesk/Arnold/mtoa/2022/bin/noice -i /Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest/ShadowTest.0001.exr -o /Volumes/RAID4TB_02/TreeGrowth/images/ShadowTest_DN/ShadowTestDN.0001.exr -pr 4 -l specular -l motionvector


The example python script includes -aov frontlight and -aov backlight, whereas I am only using aiSkydome.

Message 8 of 8

@tsines The script only prints out the commands to be run in the command line, you could instead have it run through subprocess.call 

 

As it is only an example, to use the lights you expect you should edit the light_aov_names list to have the names of your light groups 

 

I'll see if I can change the script for you to call the noice command instead of just printing it out



Ashley Handscomb Retallack
Senior Software Engineer (Arnold)
Arnold Documentation | Arnold Downloads

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report