def test_predict(wrapper, data_format, tmp_path): image = create_image(grayscale=False, data_format=data_format, tmp_path=tmp_path) result = wrapper.predict(image) assert "predicted_class" in result assert "probabilities" in result print(result) assert isinstance(result["predicted_class"], int) assert isinstance(result["probabilities"], np.ndarray) assert result["probabilities"].ndim == 1
def torch_image(): return create_image(data_format="torch", seed=0, grayscale=False)
def files_image(tmp_path): return create_image(data_format="files", seed=0, tmp_path=tmp_path)
def numpy_image(): return create_image(data_format="numpy", seed=0, grayscale=False)