Skip to content

Weapon detection using DETR model with GUI application based.

License

Notifications You must be signed in to change notification settings

hafidh561/Weapon-Detection-DETR

Repository files navigation

Weapon Detection DETR

Description

Weapon detection using DETR model with GUI application based.

Installation

$ git clone https://github.com/hafidh561/Weapon-Detection-DETR.git

Installation Python

# Python version 3.6
$ git clone https://github.com/nodefluxio/vortex.git
$ cd vortex/ && git checkout drop-enforce
$ pip install ./src/runtime[onnxruntime] && cd ../
$ pip install -r requirements.txt
$ python download_model.py

Installation Docker

# Newest docker version
# Make sure put your test images in directory ./test_images/
$ docker build -t hafidh561/weapon-detection-detr:1.0 .

Usage

Usage Python

$ python app.py -h
usage: app.py [-h] [-s SOURCE_IMG] [-c CONFIDENCE]

optional arguments:
  -h, --help            show this help message and exit
  -s SOURCE_IMG, --source-img SOURCE_IMG
                        Input your image source to detect the object
  -c CONFIDENCE, --confidence CONFIDENCE
                        Input your minimal value to detect object

# Example input
$ python app.py -s test_images/weapon0.jpg -c 0.5

Usage Docker

Prerequisite for Windows

  1. Download and install VcXsrv
  2. Run VcXsrv before run this docker app

Prerequisite for Linux

# Expose your xhost
$ xhost +local:docker

# When you finish, you can return the access control by using the following
$ xhost -local:docker

# Add environment variables
$ XSOCK=/tmp/.X11-unix
$ XAUTH=/tmp/.docker.xauth

# Create the authentication files
$ touch /tmp/.docker.xauth

# Create permission
$ xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
$ docker run --rm -e DISPLAY=<YOUR LOCAL IP ADDRESS>:0 hafidh561/weapon-detection-detr:1.0 -h
usage: app.py [-h] [-s SOURCE_IMG] [-c CONFIDENCE]

optional arguments:
  -h, --help            show this help message and exit
  -s SOURCE_IMG, --source-img SOURCE_IMG
                        Input your image source to detect the object
  -c CONFIDENCE, --confidence CONFIDENCE
                        Input your minimal value to detect object

# Example arguments input
$ docker run --rm -e DISPLAY=192.168.0.2:0 hafidh561/weapon-detection-detr:1.0 -s test_images/weapon0.jpg -c 0.5

# For Operating System Windows
$ docker run --rm -e DISPLAY=<YOUR LOCAL IP ADDRESS>:0 hafidh561/weapon-detection-detr:1.0

# For Operating System Linux
$ docker run --rm -e DISPLAY=$DISPLAY hafidh561/weapon-detection-detr:1.0

Example

result0

result1

result2

Give It a Try

If you want make your own deep learning for object detection? Give it a try in this Google Colab

License

MIT LICENSE

© Developed by hafidh561 - Internship at Nodeflux

Releases

No releases published

Packages

No packages published

Languages