@@ -637,6 +637,8 @@ def execute(self,
637
637
image_as_numpy_array : np .ndarray = image .float ().cpu ().numpy ()
638
638
639
639
cv_save_options = []
640
+ image_as_pil : PIL .Image = None
641
+ additional_args = {}
640
642
if bits == 8 :
641
643
image_scaled = np .ascontiguousarray (np .clip (image_as_numpy_array * 255 , 0 , 255 ).astype (np .uint8 ))
642
644
@@ -672,7 +674,7 @@ def execute(self,
672
674
mut_srgb_to_linear (image_as_numpy_array [:, :, :3 ])
673
675
image_scaled = image_as_numpy_array .astype (np .float32 )
674
676
if bits == 16 :
675
- cv_save_options = [cv2 .IMWRITE_EXR_TYPE , cv2 .IMWRITE_EXR_TYPE_HALF ]
677
+ cv_save_options = [cv2 .IMWRITE_EXR_TYPE , cv2 .IMWRITE_EXR_TYPE_HALF ] # pylint: disable=no-member
676
678
else :
677
679
image_scaled = np .clip (image_as_numpy_array * 65535 , 0 , 65535 ).astype (np .uint16 )
678
680
@@ -724,7 +726,7 @@ def execute(self,
724
726
with fsspec .open (uri , mode = "wb" , ** fsspec_kwargs ) as f :
725
727
image_as_pil .save (f , format = save_format , ** additional_args )
726
728
else :
727
- _ , img_encode = cv2 .imencode (f'.{ save_format } ' , image_scaled , cv_save_options )
729
+ _ , img_encode = cv2 .imencode (f'.{ save_format } ' , image_scaled , cv_save_options ) # pylint: disable=no-member
728
730
729
731
with fsspec .open (uri , mode = "wb" , ** fsspec_kwargs ) as f :
730
732
f .write (img_encode .tobytes ())
@@ -753,7 +755,7 @@ def execute(self,
753
755
if save_method == 'pil' :
754
756
image_as_pil .save (local_path , format = save_format , ** additional_args )
755
757
else :
756
- cv2 .imwrite (local_path , image_scaled )
758
+ cv2 .imwrite (local_path , image_scaled ) # pylint: disable=no-member
757
759
758
760
img_item : SaveNodeResultWithName = {
759
761
"abs_path" : str (abs_path ),
0 commit comments