@@ -250,11 +250,14 @@ def crop_resize_graph(input: Output, size: tuple[int, int], input_dtype: str = "
250250 cropped_frame = if_node .set_output (then_body_res_1 , else_body_res_1 )
251251
252252 elif desired_aspect_ratio < 1 :
253- new_width = opset .floor (
254- opset .multiply (
255- opset .convert (ih , destination_type = "f32" ),
256- desired_aspect_ratio ,
253+ new_width = opset .convert (
254+ opset .floor (
255+ opset .multiply (
256+ opset .convert (ih , destination_type = "f32" ),
257+ np .float32 (desired_aspect_ratio ),
258+ ),
257259 ),
260+ destination_type = "i32" ,
258261 )
259262 offset = opset .unsqueeze (
260263 opset .divide (
@@ -272,11 +275,14 @@ def crop_resize_graph(input: Output, size: tuple[int, int], input_dtype: str = "
272275 axes = [w_axis ],
273276 )
274277 elif desired_aspect_ratio > 1 :
275- new_hight = opset .floor (
276- opset .multiply (
277- opset .convert (iw , destination_type = "f32" ),
278- desired_aspect_ratio ,
278+ new_hight = opset .convert (
279+ opset .floor (
280+ opset .multiply (
281+ opset .convert (iw , destination_type = "f32" ),
282+ np .float32 (desired_aspect_ratio ),
283+ ),
279284 ),
285+ destination_type = "i32" ,
280286 )
281287 offset = opset .unsqueeze (
282288 opset .divide (
@@ -461,6 +467,7 @@ def window_preprocess_graph(
461467 """OV graph: window intensity scaling [center-width/2, center+width/2] to [0, 1]."""
462468 low = window_center - window_width / 2.0
463469 span = window_width
470+ # opset.clamp requires scalar float min/max, not opset.constant nodes
464471 return opset .clamp (
465472 opset .divide (
466473 opset .subtract (
@@ -469,8 +476,8 @@ def window_preprocess_graph(
469476 ),
470477 opset .constant (span , dtype = Type .f32 ),
471478 ),
472- opset . constant ( 0.0 , dtype = Type . f32 ) ,
473- opset . constant ( 1.0 , dtype = Type . f32 ) ,
479+ 0.0 ,
480+ 1.0 ,
474481 )
475482
476483
@@ -500,13 +507,14 @@ def range_scale_preprocess_graph(
500507 Multiplies by *scale_factor*, clamps to [min_value, max_value], then
501508 normalises to [0, 1] via ``(clamped - min) / (max - min)``.
502509 """
510+ # opset.clamp requires scalar float min/max, not opset.constant nodes
503511 clamped = opset .clamp (
504512 opset .multiply (
505513 opset .convert (output , destination_type = "f32" ),
506514 opset .constant (scale_factor , dtype = Type .f32 ),
507515 ),
508- opset . constant ( min_value , dtype = Type . f32 ) ,
509- opset . constant ( max_value , dtype = Type . f32 ) ,
516+ min_value ,
517+ max_value ,
510518 )
511519 range = max_value - min_value
512520 if range == 0 :
0 commit comments