File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ def automatic_instance_segmentation(
106106 ndim = image_data .ndim if ndim is None else ndim
107107
108108 if ndim == 2 :
109- if image_data .ndim != 2 or image_data .shape [- 1 ] != 3 :
109+ if ( image_data .ndim != 2 ) and ( image_data .ndim != 3 and image_data . shape [- 1 ] != 3 ) :
110110 raise ValueError (f"The inputs does not match the shape expectation of 2d inputs: { image_data .shape } " )
111111
112112 # Precompute the image embeddings.
@@ -135,7 +135,7 @@ def automatic_instance_segmentation(
135135 else :
136136 instances = mask_data_to_segmentation (masks , with_background = True , min_object_size = 0 )
137137 else :
138- if image_data .ndim != 3 or image_data .shape [- 1 ] != 3 :
138+ if ( image_data .ndim != 3 ) and ( image_data .ndim != 4 and image_data . shape [- 1 ] != 3 ) :
139139 raise ValueError (f"The inputs does not match the shape expectation of 3d inputs: { image_data .shape } " )
140140
141141 instances = automatic_3d_segmentation (
You can’t perform that action at this time.
0 commit comments