Beispiel #1
0
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
Beispiel #2
0
def torch_image():
    return create_image(data_format="torch", seed=0, grayscale=False)
Beispiel #3
0
def files_image(tmp_path):
    return create_image(data_format="files", seed=0, tmp_path=tmp_path)
Beispiel #4
0
def numpy_image():
    return create_image(data_format="numpy", seed=0, grayscale=False)