-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcolorize
executable file
·33 lines (29 loc) · 912 Bytes
/
colorize
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
#!/bin/bash
# Bash Script for automatic colorization.
# Notes:
# Replace the model path with your model.
# Set the output variable to a folder if you want your images in the same
# folder every time.
# Uncomment the gpu line if you want to use your gpu.
model=models/model.caffemodel
proto=meta/info.prototext
hull=meta/hull.npy
output=demos/
#gpu='-g'
for last; do true; done # Gets the last argument
if [ -f $1 ] && [ -n "$1" ] ; then
if [ -d $last ] && [ -n $last ] ; then
python3 colorize.py $@ -m $model -p $proto -l $hull $gpu 2> /dev/null
status=$?
elif [ -d $output ] && [ -n $output ] ; then
python3 colorize.py $@ $output -m $model -p $proto -l $hull $gpu 2> /dev/null
status=$?
else
echo 'Please specify a directory as the last argument.'
fi
if [ $status != 0 ] ; then
echo 'An error occurred, possibly due to no memory.'
fi
else
echo 'Please provide a valid filename.'
fi