Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nodes] LdrToHdr: Move import of pyalicevision within functions #2569

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions meshroom/nodes/aliceVision/LdrToHdrCalibration.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -174,6 +168,8 @@ def processChunk(self, chunk):

@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
Expand Down Expand Up @@ -251,6 +247,8 @@ def update(cls, node):

@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()
10 changes: 4 additions & 6 deletions meshroom/nodes/aliceVision/LdrToHdrMerge.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -247,6 +241,8 @@ class LdrToHdrMerge(desc.AVCommandLineNode):

@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
Expand Down Expand Up @@ -324,6 +320,8 @@ def update(cls, node):

@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()
Expand Down
10 changes: 4 additions & 6 deletions meshroom/nodes/aliceVision/LdrToHdrSampling.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -199,6 +193,8 @@ def processChunk(self, chunk):

@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
Expand Down Expand Up @@ -281,6 +277,8 @@ def update(cls, node):

@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()
Loading