This is an Abandoned Object Detection (AOD) using a TensorRT-optimized YOLOv4(416 frame size) as the object detection model.
Note that this AOD system is for the five objects below:
- backpack
- umbrella
- handback
- suitcase
- cell phone
Here's an example of the screenshot of the AOD demo.
-
First display : object detection
Person, cellphone and backpack are detected in the following situation. When persons or objects are detected, bounding boxes are displayed and the person or object's names are displayed at the top.
-
Second display : "Warning" text and yellow bounding boxes for the objects that may be left behind
After that, the yellow bounding boxes are displayed for the target objects after a certain distance and time has passed between the centroids of the detected person and the objects. At that time, the word "warning", which means the objects may be left behind, is displayed.
-
Last display : "Abandoned" text and red bounding boxes for the abandoned objects
After that, the red bounding boxes with "abandoned" text will be displayed for the abandoned objects when a certain amount of time has passed.
-
Overview
-
The flow for system processing
-
The flow of the data processing on Node-RED
-
Dashboard on Node-RED
- NVIDIA Jetson with JetPack 4.5 or later
- USB camera
Install docker-compose (You need to have docker-compose with the runtime paramter support.)
- If you already have pip installed with apt in your Jetson. Remove it.
$ sudo apt remove python3-pip
- Install pip from PyPA
$ sudo apt update
$ sudo apt install curl python3-testresources
$ curl -kL https://bootstrap.pypa.io/get-pip.py | python3
- Install docker-compose
$ python3 -m pip install --user docker-compose
- Add $HOME/.local/bin directory in your PATH.
- Comfirm docker-compose installed successfully.
$ docker-compose --version
- Add "default-runtime": "nvidia" to your /etc/docker/daemon.json configuration file to build the TensorRT plugin. And restart the docker service or reboot your system.
{
"runtimes": {
"nvidia": {
"path": "nvidia-container-runtime",
"runtimeArgs": []
}
},
"default-runtime": "nvidia"
}
- Clone this repository.
$ git clone https://github.com/MACNICA-CLAVIS-NV/abandoned_object_detection
- Add the execution permission to the shell scripts.
$ cd abandoned_object_detection
$ chmod +x ./scripts/*.sh
Start the services of the application
$ ./scripts/compose-up.sh
You can see the dashboard at http://localhost:1880/ui
Stop the services of the application
$ ./scripts/compose-down.sh
If you see the following error,
inference_1 | -------------------------------------------------------------------
inference_1 | PyCUDA ERROR: The context stack was not empty upon module cleanup.
inference_1 | -------------------------------------------------------------------
inference_1 | A context was still active when the context stack was being
inference_1 | cleaned up. At this point in our execution, CUDA may already
inference_1 | have been deinitialized, so there is no way we can finish
inference_1 | cleanly. The program will be aborted now.
inference_1 | Use Context.pop() to avoid this problem.
inference_1 | -------------------------------------------------------------------
please run the PyCUDA auto initialization alone with the following commands.
- Execute a shell in the conatainer.
$ ./scripts/docker_run.sh
- Run the following python command.
# python3 -c "import pycuda.autoinit"
- Exit from the shell in the container.
# exit
Then restat the abandoned_object_detection application.
- This application was inherited the TensorRT based YOLO implementation from jkjung-avt/tensorrt_demos. The software is under the MIT license.
- The jkjung-avt/tensorrt_demos referenced source code of NVIDIA/TensorRT samples to develop most of the demos in this repository. Those NVIDIA samples are under Apache License 2.0.
-
A brief report
Title : Let's develop the Abandoned Object Detection System using a TensorRT-optimized YOLOv4 as the model. https://www.macnica.co.jp/business/semiconductor/articles/nvidia/136416/
-
FAQ
Title : Q&A summary for implementation and deployment of the imaging analysis application with NVIDIA Jetson products https://www.macnica.co.jp/business/semiconductor/articles/nvidia/136357/