MCPcopy Create free account
hub / github.com/ModalityDance/Omni-R1 / is_valid_image

Function is_valid_image

src/transformers/src/transformers/image_utils.py:139–140  ·  view source on GitHub ↗
(img)

Source from the content-addressed store, hash-verified

137
138
139def is_valid_image(img):
140 return is_pil_image(img) or is_numpy_array(img) or is_torch_tensor(img) or is_tf_tensor(img) or is_jax_tensor(img)
141
142
143def valid_images(imgs):

Callers 15

valid_imagesFunction · 0.85
is_batchedFunction · 0.85
make_list_of_imagesFunction · 0.85
to_numpy_arrayFunction · 0.85
is_image_or_image_urlFunction · 0.85
make_list_of_imagesFunction · 0.85
make_batchedFunction · 0.85
make_batched_imagesFunction · 0.85
make_batched_videosFunction · 0.85
make_batched_videosFunction · 0.85
make_batched_videosFunction · 0.85

Calls 5

is_pil_imageFunction · 0.85
is_numpy_arrayFunction · 0.85
is_torch_tensorFunction · 0.85
is_tf_tensorFunction · 0.85
is_jax_tensorFunction · 0.85

Tested by

no test coverage detected