minor changes to python path
This commit is contained in:
parent
950214c389
commit
36ce234a8b
66
sbin/ctl.sh
66
sbin/ctl.sh
@ -19,22 +19,66 @@
|
||||
# from Dispension Industries Limited.
|
||||
#
|
||||
|
||||
# OK just so were clear, this is a pretty complicated lib. This is due
|
||||
# to all the various tools we are obliged to use due to various tech
|
||||
# we've been asked to implement, some of which is proprietary, most
|
||||
# of which is experimental and ALL of which is huge.
|
||||
# See doc for more details.
|
||||
|
||||
|
||||
HERE=$PWD
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
cd $DIR/..
|
||||
|
||||
# Read in UKDI and determine basic PATHs etc
|
||||
function f_read_ukdi(){
|
||||
cat /etc/ukdi.json |\
|
||||
tr -d '",'|\
|
||||
awk '{ if (NF>1){print "export UKDI_"$1"=\""$2"\"" } }' |\
|
||||
sed 's/://' > var/gen.ukdi
|
||||
chmod +x var/gen.ukdi
|
||||
. var/gen.ukdi
|
||||
|
||||
export ZZZ=5
|
||||
export UKDIHOST=`echo $UKDI_ukdi|tr '/:,' ' '| awk '{print $2}'`
|
||||
export UKDIPORT=`echo $UKDI_ukdi|tr '/:,' ' '| awk '{print $3}'`
|
||||
export CORE=$PWD/../core
|
||||
export UKDI=$PWD/../ukdi
|
||||
export YOLO=$PWD/../yoloserv
|
||||
|
||||
cat<<EOF
|
||||
UKDIHOST=$UKDIHOST
|
||||
UKDIPORT=$UKDIPORT
|
||||
CORE=$CORE
|
||||
UKDI=$UKDI
|
||||
EOF
|
||||
}
|
||||
f_read_ukdi
|
||||
|
||||
PORT=8099
|
||||
IMGDIR="/tmp/yoloserv_in"
|
||||
OUTDIR="/tmp/yoloserv_out"
|
||||
ZZZ=5
|
||||
|
||||
|
||||
# Assuming you're running from the yoloserv dir (eg not sbin)
|
||||
export PYTHONPATH="$PYTHONPATH:lib/yolov5-face_Jan1"
|
||||
export WEIGHTS="./lib/yolov5-face_Jan1/runs/train/exp/weights/yolov5m6_face.pt"
|
||||
echo "PYTHONPATH = $PYTHONPATH"
|
||||
# Determina all the possible libs based on whats in UKDI_yolo_devices
|
||||
LIB_OPENVINO="modules/openvino/inference_engine"
|
||||
PYP_OPENVINO="modules/openvino"
|
||||
PYP_PARAVISION="modules/paravision"
|
||||
|
||||
# WHich libs are loaded depends on the YOLO device list
|
||||
LLP=""
|
||||
PYP=""
|
||||
for i in `echo $UKDI_yolo_devices | tr ',' ' ' `
|
||||
do
|
||||
case $i in
|
||||
"paravision") LLP="$LLP:$LIB_OPENVINO"
|
||||
PYP="$PYP:$PYP_PARAVISION"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
export LD_LIBRARY_PATH="$LLP"
|
||||
export PYTHONPATH="$PYP"
|
||||
export WEIGHTS="$DIR/../modules/yolov5-face_Jan1/runs/train/exp/weights/yolov5m6_face.pt"
|
||||
|
||||
|
||||
# Install all the components.
|
||||
# There are many of them and they are all different.
|
||||
@ -125,12 +169,12 @@ function f_test(){
|
||||
}
|
||||
|
||||
function f_start(){
|
||||
mkdir -p $IMGDIR
|
||||
mkdir -p $OUTDIR
|
||||
echo $$ > var/yoloserv.pid
|
||||
echo PPPPPPPPPPPp
|
||||
echo $PYTHONPATH
|
||||
echo $$ > var/yoloserv.pid
|
||||
while [ -e var/yoloserv.pid ]
|
||||
do
|
||||
python3 src/yoloserv.py $PORT $IMGDIR $OUTDIR $WEIGHTS
|
||||
python3 src/yoloserv.py $PORT $UKDI_yolo_indir $UKDI_yolo_outdir $WEIGHTS
|
||||
sleep $ZZZ
|
||||
done
|
||||
}
|
||||
@ -162,4 +206,4 @@ esac
|
||||
|
||||
|
||||
|
||||
cd $HERE
|
||||
cd $HERE
|
||||
|
||||
@ -88,8 +88,8 @@ class yoloserv(object):
|
||||
# Object matching
|
||||
if "paravision" in self.device_list:
|
||||
print("Loading paravision...")
|
||||
from paravision import Paravision
|
||||
self.facematcher = Paravision()
|
||||
from paravisionx import Paravisionx
|
||||
self.facematcher = Paravisionx()
|
||||
self.facematcher.init()
|
||||
if "facematch" in self.device_list:
|
||||
print("Loading facematch...")
|
||||
@ -143,4 +143,4 @@ if __name__ == '__main__':
|
||||
cherrypy.config.update({'server.socket_host': '0.0.0.0',
|
||||
'server.socket_port': servport})
|
||||
cherrypy.quickstart(s, '/')
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user