Skip to content

Commit 0654247

Browse files
committed
[nodes] LdrToHdr: Move import of pyalicevision within functions
Since `pyalicevision`, which is provided outside of Meshroom's repository, is now needed for all the LdrToHdr nodes, importing `pyalicevision` at the function level rather than at the file level allows the CI to pass even if `pyalicevision` is not available.
1 parent 9be7c03 commit 0654247

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

meshroom/nodes/aliceVision/LdrToHdrCalibration.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
import os
66
from collections import Counter
77

8-
from pyalicevision import sfmData as avsfmdata
9-
from pyalicevision import hdr as avhdr
10-
118
from meshroom.core import desc
129
from meshroom.core.utils import COLORSPACES, VERBOSE_LEVEL
1310

@@ -174,6 +171,8 @@ def processChunk(self, chunk):
174171

175172
@classmethod
176173
def update(cls, node):
174+
from pyalicevision import hdr as avhdr
175+
177176
if not isinstance(node.nodeDesc, cls):
178177
raise ValueError("Node {} is not an instance of type {}".format(node, cls))
179178
# TODO: use Node version for this test
@@ -251,6 +250,8 @@ def update(cls, node):
251250

252251
@staticmethod
253252
def getExposure(exp, refIso = 100.0, refFnumber = 1.0):
253+
from pyalicevision import sfmData as avsfmdata
254+
254255
fnumber, shutterSpeed, iso = exp
255256
obj = avsfmdata.ExposureSetting(shutterSpeed, fnumber, iso)
256257
return obj.getExposure()

meshroom/nodes/aliceVision/LdrToHdrMerge.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
import math
66
from collections import Counter
77

8-
from pyalicevision import sfmData as avsfmdata
9-
from pyalicevision import hdr as avhdr
10-
118
from meshroom.core import desc
129
from meshroom.core.utils import COLORSPACES, EXR_STORAGE_DATA_TYPE, VERBOSE_LEVEL
1310

@@ -247,6 +244,8 @@ class LdrToHdrMerge(desc.AVCommandLineNode):
247244

248245
@classmethod
249246
def update(cls, node):
247+
from pyalicevision import hdr as avhdr
248+
250249
if not isinstance(node.nodeDesc, cls):
251250
raise ValueError("Node {} is not an instance of type {}".format(node, cls))
252251
# TODO: use Node version for this test
@@ -324,6 +323,8 @@ def update(cls, node):
324323

325324
@staticmethod
326325
def getExposure(exp, refIso = 100.0, refFnumber = 1.0):
326+
from pyalicevision import sfmData as avsfmdata
327+
327328
fnumber, shutterSpeed, iso = exp
328329
obj = avsfmdata.ExposureSetting(shutterSpeed, fnumber, iso)
329330
return obj.getExposure()

meshroom/nodes/aliceVision/LdrToHdrSampling.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
import os
66
from collections import Counter
77

8-
from pyalicevision import sfmData as avsfmdata
9-
from pyalicevision import hdr as avhdr
10-
118
from meshroom.core import desc
129
from meshroom.core.utils import COLORSPACES, VERBOSE_LEVEL
1310

@@ -199,6 +196,8 @@ def processChunk(self, chunk):
199196

200197
@classmethod
201198
def update(cls, node):
199+
from pyalicevision import hdr as avhdr
200+
202201
if not isinstance(node.nodeDesc, cls):
203202
raise ValueError("Node {} is not an instance of type {}".format(node, cls))
204203
# TODO: use Node version for this test
@@ -281,6 +280,8 @@ def update(cls, node):
281280

282281
@staticmethod
283282
def getExposure(exp, refIso = 100.0, refFnumber = 1.0):
283+
from pyalicevision import sfmData as avsfmdata
284+
284285
fnumber, shutterSpeed, iso = exp
285286
obj = avsfmdata.ExposureSetting(shutterSpeed, fnumber, iso)
286287
return obj.getExposure()

0 commit comments

Comments
 (0)