diff --git a/app/exe/spark b/app/exe/spark index 4e3080d..cdbb5b5 100755 Binary files a/app/exe/spark and b/app/exe/spark differ diff --git a/app/src/parkinglot_detection.cpp b/app/src/parkinglot_detection.cpp index f633ca5..5fd1018 100644 --- a/app/src/parkinglot_detection.cpp +++ b/app/src/parkinglot_detection.cpp @@ -222,7 +222,7 @@ void get_patches(int event, int x, int y, int flags, void *param) rectangle(img, boxes[i], AVNET_COMPLEMENTARY, 2); } box_end = Point2f(x, y); - imshow("image", frame_copy); + imshow("Draw boxes with mouse, press to return to inference", frame_copy); } /***************************************** * Function Name : draw_rectangle @@ -238,9 +238,9 @@ int draw_rectangle(void) putText(img, "id: " + to_string(i + 1), Point(boxes[i].x + 10, boxes[i].y - 10), FONT_HERSHEY_DUPLEX, 1.0, Scalar(255, 0, 0), 2); } unsigned int key = 0; - cv::namedWindow("image", cv::WINDOW_NORMAL); - cv::imshow("image", img); - cv::setMouseCallback("image", get_patches, &img); + cv::namedWindow("Draw boxes with mouse, press to return to inference", cv::WINDOW_NORMAL); + cv::imshow("Draw boxes with mouse, press to return to inference", img); + cv::setMouseCallback("Draw boxes with mouse, press to return to inference", get_patches, &img); key = cv::waitKey(0); std::cout << "key:" << key << "\n"; if (key == 114) // Wait for 'r' key press to redraw!! diff --git a/deploy.sh b/deploy.sh index 8e9cf1a..8595a6e 100755 --- a/deploy.sh +++ b/deploy.sh @@ -12,6 +12,7 @@ TARGET=$1 set -ex scp -r ./app/exe/ "root@${TARGET}:/home/root/dev/" + scp -r ./utils/ "root@${TARGET}:/home/root/dev/" ssh "root@${TARGET}" "mkdir -p /opt/spark/iot" scp ./app/iot/*.json "${TARGET}:/opt/spark/iot/" scp ./app/iot/iotc-spark-server.service "${TARGET}:/etc/systemd/system/" diff --git a/install.sh b/install.sh index 2779040..678b283 100755 --- a/install.sh +++ b/install.sh @@ -4,20 +4,27 @@ INSTALL_DIR=/opt/spark mkdir -p "${INSTALL_DIR}" +echo "Installing SPARK executables, utils, and libs into RZBoard... The executables will be copied to ${INSTALL_DIR} directory." cp -r ./app/exe/* "${INSTALL_DIR}" || { echo "Failed to copy SPARK to RZBoard"; exit 1;} +cp -r ./utils/* "${INSTALL_DIR}" || { echo "Failed to copy SPARK utils to RZBoard";} cp ./runtime_deps/libtvm_runtime.so /usr/lib64/ || { echo "Failed to copy TVM runtime to RZboard"; exit 1;} -cat ./app/weston_conf/weston.ini.append >> /etc/xdg/weston/weston.ini || { echo "Failed to append weston.ini"; exit 1;} +cat ./app/weston_conf/weston.ini.append >> /etc/xdg/weston/weston.ini || { echo "Failed to append weston.ini. You will have to run spark from ${INSTALL_DIR}";} +echo "Done installing SPARK executables, utils, and libs into RZBoard..." # IoT Config +echo "Installing IoT Connect configurations into RZBoard..." mkdir -p ${INSTALL_DIR}/iot || { echo "Failed to create iot directory"; exit 1;} cp ./app/iot/*.json ${INSTALL_DIR}/iot/ || { echo "Failed to copy iot json files"; exit 1;} echo "Don't forget to update /opt/spark/iot/ config files with your own device keys/server orientation" +echo "Done installing IoT Connect configurations into RZBoard..." # Service management +echo "Installing IoT Connect / SPARK Service into RZBoard... The service will be enabled (auto launches on internet connection) and started after installation." cp ./app/iot/iotc-spark-server.service /etc/systemd/system/ || { echo "Failed to copy iotc-spark-server.service"; exit 1;} systemctl daemon-reload systemctl enable iotc-spark-server.service || { echo "Failed to enable iotc-spark-server.service"; exit 1;} systemctl start iotc-spark-server.service || { echo "Failed to start iotc-spark-server.service"; exit 1;} +echo "Done installing IoT Connect / SPARK Service into RZBoard... The service is enabled and started after installation." echo "SPARK installed successfully. Restarting Weston for changes to take effect."