Mise à jour du Art Compagnon pack V 4.1

Wait 5 sec.

nind_denoise_raw.zip (1,9 Ko)#!/bin/bash# select the device to use for denoising (cuda, mps, cpu, ...)DEVICE=cpu# Python interpreter to usePYTHON=$HOME/Programmes/nind-denoise-env/bin/python# directory where nind-denoise is locatedNIND_DENOISE_DIR=$HOME/Programmes/nind-denoiseexport PATH=$HOME/.local/bin:/opt/local/bin:/usr/local/bin:$PATHART_CLI=ART-cli############################################################################## create a temporary dir for storing a default processing profile# and error information# create an .arp sidecar with a custom output profile and settings# suitable for denoisingd=$(mktemp -d)t=$d/p1.arpcat "$d/p2.arp" sidecar=("-p" "$d/p2.arp")else # if the selected file has no sidecar, we create a default one sidecar=() cat $t[Exposure]HLRecovery=Balanced[ToneCurve]Enabled=false[RAW]CAEnabled=trueCA=trueCAAvoidColourshift=trueCAAutoIterations=2HotDeadPixelEnabled=trueHotPixelFilter=trueDeadPixelFilter=trueHotDeadPixelThresh=100EOFfi# process the raw files with ART-cli, adding a progress dialog # for user notification"${ART_CLI}" --progress "${sidecar[@]}" -p $t -Y -t -b16 -o "$d/out.tif" -c "$@" 2>"$d/error" \ | zenity --width=500 --progress --auto-close --text="Converting to TIFF..."# a non-zero exit status means the user cancelled the operationif [ $? -ne 0 ]; then # if so, we just exit gracefully rm -rf $d exit 0fi# check if there was an errorerr=if [ -f "$d/error" ]; then err=$(cat "$d/error")fiif [ "$err" != "" ]; then # show the error message if something went wrong zenity --error --text="$err"else err="" # otherwise, let's denoise ifile=${d}/out.tif outfile=${d}/denoised.tif # model to use DENOISE_MODEL=$NIND_DENOISE_DIR/models/nind_denoise/2019-02-18T20:10_run_nn.py_--time_limit_259200_--batch_size_94_--test_reserve_ursulines-red_stefantiek_ursulines-building_MuseeL-Bobo_CourtineDeVillersDebris_MuseeL-Bobo-C500D_--skip_sizecheck_--lr_3e-4/model_257.pth ("$PYTHON" "${NIND_DENOISE_DIR}/src/nind_denoise/denoise_image.py" \ --network UNet \ --model_path "${DENOISE_MODEL}" \ --device $DEVICE \ --cs 512 \ --ucs 400 \ --input "${ifile}" \ -o "${outfile}" \ 2>&1) | zenity --progress --text="Denoising..." --pulsate --auto-kill --auto-close res=$? on="${1%.*}-denoised.tif" i=1 while [ -f "${on}" ]; do on="${1%.*}-denoised-${i}.tif" i=$(expr $i + 1) done if [ $res -eq 0 ]; then mv "${outfile}" "${on}" # finally, use the same sidecar for the denoise image as for the # original image, except that we override WB and denoising settings if [ -f "$1.arp" ]; then cp "$1.arp" "${on}.arp" cat "${on}.arp"[Exposure]Enabled=false[White Balance]Enabled=trueSetting=Camera[Impulse Denoising]Enabled=false[Denoise]Enabled=falseEOF fi else zenity --error --text="Denoising error!" fifi# remove the temporary dirrm -rf $d