diff --git a/scripts/unittest/data/cifar10_fast.network b/scripts/unittest/data/cifar10_fast.network new file mode 100644 index 000000000..44e3fc30a Binary files /dev/null and b/scripts/unittest/data/cifar10_fast.network differ diff --git a/scripts/unittest/script/21-nn_cifar10.py b/scripts/unittest/script/21-nn_cifar10.py index 56fd5f2b1..e99dec66e 100644 --- a/scripts/unittest/script/21-nn_cifar10.py +++ b/scripts/unittest/script/21-nn_cifar10.py @@ -5,11 +5,11 @@ def unittest(data_path, temp_path): files = os.listdir(test_dir) total = len(files) labels = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck'] - net = nn.load('/cifar10_fast.network') + net = nn.load(data_path+'/cifar10_fast.network') for f in sorted(files): img = image.Image(test_dir+"/"+f, copy_to_fb=True) out = net.forward(img) label = labels[out.index(max(out))] if (f.split('-')[0] == label): match += 1 - return (total == 21 and match == 19) + return ((match / total * 100 ) > 90)