Merge pull request #2569 from alicevision/dev/pyavImports

[nodes] LdrToHdr: Move import of `pyalicevision` within functions
This commit is contained in:
Candice Bentéjac 2024-10-15 13:37:28 +01:00 committed by GitHub
commit bf6244e831
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 18 deletions

View file

@ -1,12 +1,6 @@
__version__ = "3.1"
import json
import math
import os
from collections import Counter
from pyalicevision import sfmData as avsfmdata
from pyalicevision import hdr as avhdr
from meshroom.core import desc
from meshroom.core.utils import COLORSPACES, VERBOSE_LEVEL
@ -174,6 +168,8 @@ Calibrate LDR to HDR response curve from samples.
@classmethod
def update(cls, node):
from pyalicevision import hdr as avhdr
if not isinstance(node.nodeDesc, cls):
raise ValueError("Node {} is not an instance of type {}".format(node, cls))
# TODO: use Node version for this test
@ -251,6 +247,8 @@ Calibrate LDR to HDR response curve from samples.
@staticmethod
def getExposure(exp, refIso = 100.0, refFnumber = 1.0):
from pyalicevision import sfmData as avsfmdata
fnumber, shutterSpeed, iso = exp
obj = avsfmdata.ExposureSetting(shutterSpeed, fnumber, iso)
return obj.getExposure()

View file

@ -1,12 +1,6 @@
__version__ = "4.1"
import json
import os
import math
from collections import Counter
from pyalicevision import sfmData as avsfmdata
from pyalicevision import hdr as avhdr
from meshroom.core import desc
from meshroom.core.utils import COLORSPACES, EXR_STORAGE_DATA_TYPE, VERBOSE_LEVEL
@ -247,6 +241,8 @@ Merge LDR images into HDR images.
@classmethod
def update(cls, node):
from pyalicevision import hdr as avhdr
if not isinstance(node.nodeDesc, cls):
raise ValueError("Node {} is not an instance of type {}".format(node, cls))
# TODO: use Node version for this test
@ -324,6 +320,8 @@ Merge LDR images into HDR images.
@staticmethod
def getExposure(exp, refIso = 100.0, refFnumber = 1.0):
from pyalicevision import sfmData as avsfmdata
fnumber, shutterSpeed, iso = exp
obj = avsfmdata.ExposureSetting(shutterSpeed, fnumber, iso)
return obj.getExposure()

View file

@ -1,12 +1,6 @@
__version__ = "4.0"
import json
import math
import os
from collections import Counter
from pyalicevision import sfmData as avsfmdata
from pyalicevision import hdr as avhdr
from meshroom.core import desc
from meshroom.core.utils import COLORSPACES, VERBOSE_LEVEL
@ -199,6 +193,8 @@ Sample pixels from Low range images for HDR creation.
@classmethod
def update(cls, node):
from pyalicevision import hdr as avhdr
if not isinstance(node.nodeDesc, cls):
raise ValueError("Node {} is not an instance of type {}".format(node, cls))
# TODO: use Node version for this test
@ -281,6 +277,8 @@ Sample pixels from Low range images for HDR creation.
@staticmethod
def getExposure(exp, refIso = 100.0, refFnumber = 1.0):
from pyalicevision import sfmData as avsfmdata
fnumber, shutterSpeed, iso = exp
obj = avsfmdata.ExposureSetting(shutterSpeed, fnumber, iso)
return obj.getExposure()