Merge pull request 'fix dd01 slow stitching due to disabled numba and added numba check for stitching' (#1) from fix/dd01_slow into dev
Reviewed-on: http://100.106.67.31:3000/orisys-tech/orisys-sdk/pulls/1
This commit was merged in pull request #1.
This commit is contained in:
+21
-2
@@ -3,9 +3,22 @@ import numpy as np
|
|||||||
import scipy.fft
|
import scipy.fft
|
||||||
from scipy import ndimage
|
from scipy import ndimage
|
||||||
import cv2
|
import cv2
|
||||||
# from numba import njit
|
|
||||||
|
|
||||||
# @njit(cache=False)
|
try:
|
||||||
|
from numba import njit
|
||||||
|
|
||||||
|
_NUMBA_AVAILABLE = True
|
||||||
|
except ImportError:
|
||||||
|
_NUMBA_AVAILABLE = False
|
||||||
|
|
||||||
|
def njit(*args, **kwargs):
|
||||||
|
def decorator(fn):
|
||||||
|
return fn
|
||||||
|
|
||||||
|
return decorator
|
||||||
|
|
||||||
|
|
||||||
|
@njit(cache=False)
|
||||||
def _blend_kernel(blend_patch, wsum_patch, cov_patch, src_patch, w_patch):
|
def _blend_kernel(blend_patch, wsum_patch, cov_patch, src_patch, w_patch):
|
||||||
"""Fused incremental weighted-average composite (numba-accelerated)."""
|
"""Fused incremental weighted-average composite (numba-accelerated)."""
|
||||||
sh = src_patch.shape[0]
|
sh = src_patch.shape[0]
|
||||||
@@ -73,6 +86,12 @@ class Stitcher:
|
|||||||
self._feature_stitch_pad = 5
|
self._feature_stitch_pad = 5
|
||||||
self._feature_stitch_match_brightness = False
|
self._feature_stitch_match_brightness = False
|
||||||
|
|
||||||
|
if self.isstitch and not _NUMBA_AVAILABLE:
|
||||||
|
print(
|
||||||
|
"Warning: numba is not installed; feature stitching will run a slow "
|
||||||
|
"Python blend path (~1 FPS). Install numba for real-time performance."
|
||||||
|
)
|
||||||
|
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
print(f"Stitcher initialized with config: {self.config_stitcher}")
|
print(f"Stitcher initialized with config: {self.config_stitcher}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user