def __init__(self): super().__init__() self.c = img_client.ClientSocket(self) #self.d = MysqlController.MysqlController('223.171.42.36','mgt','aA!12345','maviz') #self.d = MysqlController.MysqlController('172.17.1.153','mgt','aA!12345','maviz') #self.d = MysqlController.MysqlController('172.17.0.161','mgt','aA!12345','maviz') #self.d = MysqlController.MysqlController('192.168.0.183','mgt','aA!12345','maviz') self.d = MysqlController.MysqlController('localhost', 'mgt', 'aA!12345', 'maviz') self.f = recognizer.featureMatcher() self.iv = QMUtil.ImageViewer() self.det = detect.Detector() self.initUI()
if len(res_target) > 0: for res_one in res_target: detects.append({ "type": targettype, "rect": [int(x) for x in res_one[:4]], "accuracy": float(res_one[4]), }) detects.sort(key=lambda o: o["accuracy"], reverse=True) return detects if __name__ == '__main__': cap = cv2.VideoCapture(0) detector = detect.Detector(0.5, 0.5) while True: ret, frame = cap.read() frame = cv2.resize(frame, dsize=(416, 416), interpolation=cv2.INTER_NEAREST) # Detect start = time.time() result = detector.detect(frame) print("***TIME:", time.time() - start) # Show Result res_ordered = result_ordered(result, { "person": 0,
def _init_detector(args): d = detect.Detector(args.graph, args.labels, args.box_line_size) d.step = 0 return d
def __init__(self, detType): if detType == "object": self.detector = detect.Detector(self.objmodel) else: print("Passing parameter error!!!")