Last active
November 29, 2020 23:02
-
-
Save AlexeyGy/4c31ac2f719c022bc71dcb67df053d19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from logging import info | |
from typing import List | |
import numpy as np | |
import cv2 as cv | |
INPUT_FOLDER = "model/" # where we read the neural network from | |
# a pretrained model from OpenVino, see https://docs.openvinotoolkit.org/2018_R5/_docs_Retail_object_detection_pedestrian_rmnet_ssd_0013_caffe_desc_person_detection_retail_0013.html | |
NETWORK_NAME = "person-detection-retail-0013" | |
def set_up_inference(): | |
net = cv.dnn.readNet( | |
os.path.join(INPUT_FOLDER, NETWORK_NAME + ".bin"), | |
os.path.join(INPUT_FOLDER, NETWORK_NAME + ".xml"), | |
) | |
net.setPreferableTarget(cv.dnn.DNN_TARGET_MYRIAD) | |
return net |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment