Skip to content

Instantly share code, notes, and snippets.

@AlexeyGy
Last active November 29, 2020 23:02
Show Gist options
  • Save AlexeyGy/4c31ac2f719c022bc71dcb67df053d19 to your computer and use it in GitHub Desktop.
Save AlexeyGy/4c31ac2f719c022bc71dcb67df053d19 to your computer and use it in GitHub Desktop.
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