Skip to content

Commit bf6244e

Browse files
authored
Merge pull request #2569 from alicevision/dev/pyavImports
[nodes] LdrToHdr: Move import of `pyalicevision` within functions
2 parents 45c72d2 + cb43fd4 commit bf6244e

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

meshroom/nodes/aliceVision/LdrToHdrCalibration.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
__version__ = "3.1"
22

33
import json
4-
import math
5-
import os
6-
from collections import Counter
7-
8-
from pyalicevision import sfmData as avsfmdata
9-
from pyalicevision import hdr as avhdr
104

115
from meshroom.core import desc
126
from meshroom.core.utils import COLORSPACES, VERBOSE_LEVEL
@@ -174,6 +168,8 @@ def processChunk(self, chunk):
174168

175169
@classmethod
176170
def update(cls, node):
171+
from pyalicevision import hdr as avhdr
172+
177173
if not isinstance(node.nodeDesc, cls):
178174
raise ValueError("Node {} is not an instance of type {}".format(node, cls))
179175
# TODO: use Node version for this test
@@ -251,6 +247,8 @@ def update(cls, node):
251247

252248
@staticmethod
253249
def getExposure(exp, refIso = 100.0, refFnumber = 1.0):
250+
from pyalicevision import sfmData as avsfmdata
251+
254252
fnumber, shutterSpeed, iso = exp
255253
obj = avsfmdata.ExposureSetting(shutterSpeed, fnumber, iso)
256254
return obj.getExposure()

meshroom/nodes/aliceVision/LdrToHdrMerge.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
__version__ = "4.1"
22

33
import json
4-
import os
5-
import math
6-
from collections import Counter
7-
8-
from pyalicevision import sfmData as avsfmdata
9-
from pyalicevision import hdr as avhdr
104

115
from meshroom.core import desc
126
from meshroom.core.utils import COLORSPACES, EXR_STORAGE_DATA_TYPE, VERBOSE_LEVEL
@@ -247,6 +241,8 @@ class LdrToHdrMerge(desc.AVCommandLineNode):
247241

248242
@classmethod
249243
def update(cls, node):
244+
from pyalicevision import hdr as avhdr
245+
250246
if not isinstance(node.nodeDesc, cls):
251247
raise ValueError("Node {} is not an instance of type {}".format(node, cls))
252248
# TODO: use Node version for this test
@@ -324,6 +320,8 @@ def update(cls, node):
324320

325321
@staticmethod
326322
def getExposure(exp, refIso = 100.0, refFnumber = 1.0):
323+
from pyalicevision import sfmData as avsfmdata
324+
327325
fnumber, shutterSpeed, iso = exp
328326
obj = avsfmdata.ExposureSetting(shutterSpeed, fnumber, iso)
329327
return obj.getExposure()

meshroom/nodes/aliceVision/LdrToHdrSampling.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
__version__ = "4.0"
22

33
import json
4-
import math
5-
import os
6-
from collections import Counter
7-
8-
from pyalicevision import sfmData as avsfmdata
9-
from pyalicevision import hdr as avhdr
104

115
from meshroom.core import desc
126
from meshroom.core.utils import COLORSPACES, VERBOSE_LEVEL
@@ -199,6 +193,8 @@ def processChunk(self, chunk):
199193

200194
@classmethod
201195
def update(cls, node):
196+
from pyalicevision import hdr as avhdr
197+
202198
if not isinstance(node.nodeDesc, cls):
203199
raise ValueError("Node {} is not an instance of type {}".format(node, cls))
204200
# TODO: use Node version for this test
@@ -281,6 +277,8 @@ def update(cls, node):
281277

282278
@staticmethod
283279
def getExposure(exp, refIso = 100.0, refFnumber = 1.0):
280+
from pyalicevision import sfmData as avsfmdata
281+
284282
fnumber, shutterSpeed, iso = exp
285283
obj = avsfmdata.ExposureSetting(shutterSpeed, fnumber, iso)
286284
return obj.getExposure()

0 commit comments

Comments
 (0)