Handle Keyword dict keys in fused-pipeline primitive
This commit is contained in:
@@ -858,6 +858,19 @@ except ImportError as e:
|
||||
_FUSED_PIPELINE_CACHE = {}
|
||||
|
||||
|
||||
def _normalize_effect_dict(effect):
|
||||
"""Convert effect dict with Keyword keys to string keys."""
|
||||
result = {}
|
||||
for k, v in effect.items():
|
||||
# Handle Keyword objects from sexp parser
|
||||
if hasattr(k, 'name'): # Keyword object
|
||||
key = k.name
|
||||
else:
|
||||
key = str(k)
|
||||
result[key] = v
|
||||
return result
|
||||
|
||||
|
||||
def prim_fused_pipeline(img, effects_list, **dynamic_params):
|
||||
"""
|
||||
Apply a fused CUDA kernel pipeline to an image.
|
||||
@@ -879,6 +892,9 @@ def prim_fused_pipeline(img, effects_list, **dynamic_params):
|
||||
|
||||
Supported ops: rotate, zoom, ripple, invert, hue_shift, brightness
|
||||
"""
|
||||
# Normalize effects list - convert Keyword keys to strings
|
||||
effects_list = [_normalize_effect_dict(e) for e in effects_list]
|
||||
|
||||
if not _FUSED_KERNELS_AVAILABLE:
|
||||
# Fallback: apply effects one by one
|
||||
result = img
|
||||
|
||||
Reference in New Issue
Block a user