Skip to content

Latest commit

 

History

History
 
 

DET

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

AOS/DET: Person Classification for Airborne Optical Sectioning

This is a Python implementation for the person classification used in Airborne Optical Sectioning. Inference is done with the OpenVINO toolkit and supports performance boosts via Intel's Neural Compute Stick and similar VPUs. The latter is a requirement to run object detection on low-power devices such as a Raspberry Pi.

detections

Requirements

Install the OpenVINO toolkit and make sure it is running. Before running any Python script make sure that you setup the OpenVINO environment variables.

On Windows the followng command can be used:

"C:\Program Files (x86)\IntelSWTools\openvino\bin\setupvars.bat"

On Linux the command is:

source /opt/intel/openvino_*/bin/setupvars.sh

Quick tutorial

To apply person classification on images you can use detector.py. Have a look at the following example:

from detecor import Detector
threshold = .05

# init the detector with the weights stored in the xml and bin files
det = Detector()
weights_file = os.path.join( 'DET', 'weights', 'yolov4-tiny.xml')
det.init(weights_file, device = 'CPU' ) # for VPUs use device = "MYRIAD"

image_folder = os.path.join( 'data', 'open_field', 'results') 

for filename in glob.glob( os.path.join( image_folder, '*[!_Detected].png' ) ): # read pngs in a folder
    
    # read the image
    img = cv2.imread(filename)

    # detect persons in the iamge
    dimg, detections = det.detect(img, prob_threshold = threshold)

    # display the detections with opencv
    cv2.imshow( filename, dimg )

# wait for user input
cv2.waitKey()

More detailed usage

The training was performed with the Darknet software using the YOLOv4-tiny architecture. For details on training the classifier, refer to our most recent publications. A trained network is provided in the weights folder.

References/License

The OpenVINO detector is based on the YOLOv3 example in the OpenVINO Toolkit with some modifications by Wu Tianwen on the OpenVINO-YOLOV4 Github repository. Note that the OpenVINO examples (the basis for the detector) are licensed under the Apache License Version 2.0 by Intel:

http://www.apache.org/licenses/LICENSE-2.0