UPDATE Vision 更新模型
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
'''
|
||||
# @Time : 2024/9/25 11:47
|
||||
# @Author : hjw
|
||||
@ -23,7 +24,7 @@ class DetectionPerson:
|
||||
:return: person [bool], img [ndarray]
|
||||
"""
|
||||
def __init__(self) -> None:
|
||||
model_path = ''.join([os.getcwd(), '/Vision/model/pt/person.pt'])
|
||||
model_path = ''.join([os.getcwd(), '/Vision/model/pt/person_detect.pt'])
|
||||
ip = "192.168.1.65"
|
||||
port = 554
|
||||
name = "admin"
|
||||
@ -61,10 +62,10 @@ class DetectionPerson:
|
||||
# cv2.imshow('img2', img_src)
|
||||
# cv2.waitKey(1)
|
||||
for result in results:
|
||||
if self.names[result[5]]=="person":
|
||||
if self.names[result[5]] == "person":
|
||||
person = True
|
||||
conf = round(result[4], 2)
|
||||
#print(conf)
|
||||
# print(conf)
|
||||
self.draw_box(img_src, result[:4], conf, self.names[result[5]], lw, sf, tf)
|
||||
|
||||
return person, img_src
|
||||
|
||||
Reference in New Issue
Block a user