Skip to content

Commit 45312a1

Browse files
committed
add test
1 parent 16f41ad commit 45312a1

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

test/__init__.py

Whitespace-only changes.

test/test_predict.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import torch
2+
from src.predict import predict
3+
4+
5+
model_path = "src/checkpoint/checkpoint_notebook.pth"
6+
image_path = "src/data/test/Akainu/modified_203.png"
7+
device = "cuda" if torch.cuda.is_available() else "cpu"
8+
9+
def test_single_predict():
10+
# given
11+
expected_pred = "Akainu"
12+
13+
# when
14+
pred = predict(model_path=model_path, image_path=image_path, device=device)
15+
16+
# then
17+
assert pred == expected_pred

0 commit comments

Comments
 (0)