-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.sh
executable file
·64 lines (54 loc) · 2.53 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
#./build.sh
docker volume create airogs_algorithm-output
docker run --rm \
--network none \
--memory=15g \
--memory-swap=15g \
--cap-drop=ALL \
--security-opt="no-new-privileges" \
--shm-size=128m \
--pids-limit=256 \
-v $SCRIPTPATH/test/:/input \
-v airogs_algorithm-output:/output/ \
airogs_algorithm
docker run --rm \
-v airogs_algorithm-output:/output/ \
--network none \
--memory=15g \
--memory-swap=15g \
--cap-drop=ALL \
--security-opt="no-new-privileges" \
--shm-size=128m \
--pids-limit=256 \
pytorch/pytorch:1.9.0-cuda11.1-cudnn8-runtime cat /output/multiple-referable-glaucoma-likelihoods.json /output/multiple-referable-glaucoma-binary.json /output/multiple-ungradability-scores.json /output/multiple-ungradability-binary.json
# docker run --rm \
# -v airogs_algorithm-output:/output/ \
# -v $SCRIPTPATH/test/:/input \
# --network none \
# --memory=15g \
# --memory-swap=15g \
# --cap-drop=ALL \
# --security-opt="no-new-privileges" \
# --shm-size=128m \
# --pids-limit=256 \
# pytorch/pytorch:1.9.0-cuda11.1-cudnn8-runtime python -c """import json, sys
# referable_glaucoma_likelihood = json.load(open('/output/multiple-referable-glaucoma-likelihoods.json'))
# referable_glaucoma_binary = json.load(open('/output/multiple-referable-glaucoma-binary.json'))
# ungradability_score = json.load(open('/output/multiple-ungradability-scores.json'))
# ungradability_binary = json.load(open('/output/multiple-ungradability-binary.json'))
# exp_referable_glaucoma_likelihood = json.load(open('/input/expected-multiple-referable-glaucoma-likelihoods.json'))
# exp_referable_glaucoma_binary = json.load(open('/input/expected-multiple-referable-glaucoma-binary.json'))
# exp_ungradability_score = json.load(open('/input/expected-multiple-ungradability-scores.json'))
# exp_ungradability_binary = json.load(open('/input/expected-multiple-ungradability-binary.json'))
# sys.exit((referable_glaucoma_likelihood != exp_referable_glaucoma_likelihood) |
# (referable_glaucoma_binary != exp_referable_glaucoma_binary) |
# (ungradability_score != exp_ungradability_score) |
# (ungradability_binary != exp_ungradability_binary))"""
if [ $? -eq 0 ]; then
echo "Tests successfully passed..."
else
echo "Expected output was not found..."
fi
docker volume rm airogs_algorithm-output