-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeepflow
More file actions
executable file
·52 lines (52 loc) · 1.74 KB
/
deepflow
File metadata and controls
executable file
·52 lines (52 loc) · 1.74 KB
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
#!/bin/bash
if [ $# -eq 0 ]
then
echo "No arguments supplied"
echo "deepflow <folder of DICOM files> <optional 'cpu' or 'arm' flag>"
exit
fi
folder="$1"
d=$(date +"%Y-%m-%d-%T")
echo "Welcome to DeepFlow!"
output=$(pwd)/output/
mkdir -p "$output"
if [ -z "$2" ]
then
echo -e "Using GPU acceleration.\nMake sure that the NVIDIA Drivers and container toolkits are installed."
echo "Working on folder: $folder"
docker run -u=$(id -u $USER):$(id -g $USER) \
--gpus all \
-v $(pwd)/assets:/assets \
-v "$output":/output \
-v ~/:/data/ \
-v "$folder":/input \
--rm \
saditya88/deepflow:gpu /input 1>"$output"/Run_"$d".log 2>"$output"/Warns_"$d".log
elif [ $2 == "cpu" ]
then
echo -e "CPU mode selected.\nPerformance might be slower."
docker run -u=$(id -u $USER):$(id -g $USER) \
-v $(pwd)/assets:/assets \
-v "$output":/output \
-v ~/:/data/ \
-v "$folder":/input \
--rm \
saditya88/deepflow:cpu /input 1>"$output"/Run_"$d".log 2>"$output"/Warns_"$d".log
elif [ $2 == "arm" ]
then
echo -e "ARM mode selected.\nOnly CPU is supported in this mode.\nPerformance might be slower."
docker run -u=$(id -u $USER):$(id -g $USER) \
-v $(pwd)/assets:/assets \
-v "$output":/output \
-v ~/:/data/ \
-v "$folder":/input \
--rm \
saditya88/deepflow:arm /input 1>"$output"/Run_"$d".log 2>"$output"/Warns_"$d".log
else
echo Unknwn input: "$folder"
echo Only 'cpu/arm' are accepted as an input
echo If you wish to use the GPU version, no arguments are required.
exit
fi
echo "All done."
echo "Thanks for using deepFlow"