未戴安全帽算法修改测试

This commit is contained in:
曹前明 2022-08-31 09:31:42 +08:00
parent 3bb9a5ab79
commit e9fe902618
4 changed files with 64 additions and 62 deletions

View File

@ -18,7 +18,7 @@ message JinYu_Request {
message BHhelmet_Response {
int64 zzid = 1; //ID
repeated HelmetInfo helmetinfoList = 2; //0: 1
repeated HelmetInfo helmetinfoList = 2; //0: 1 2:
}
message Point {

View File

@ -12,47 +12,50 @@ from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11\x42\x65iHangGrpc.proto\"A\n\rJinYu_Request\x12\x0c\n\x04zzid\x18\x01 \x01(\x03\x12\x12\n\nimgsbase64\x18\x02 \x01(\t\x12\x0e\n\x06imgUrl\x18\x03 \x01(\t\"F\n\x11\x42Hhelmet_Response\x12\x0c\n\x04zzid\x18\x01 \x01(\x03\x12#\n\x0ehelmetinfoList\x18\x02 \x03(\x0b\x32\x0b.HelmetInfo\"\x1d\n\x05Point\x12\t\n\x01x\x18\x01 \x01(\x01\x12\t\n\x01y\x18\x02 \x01(\x01\":\n\tRectangle\x12\x15\n\x05uleft\x18\x01 \x01(\x0b\x32\x06.Point\x12\x16\n\x06lright\x18\x02 \x01(\x0b\x32\x06.Point\"J\n\nHelmetInfo\x12\x13\n\x0bhead_helmet\x18\x01 \x01(\x03\x12\x0c\n\x04\x63onf\x18\x02 \x01(\x01\x12\x19\n\x05\x63oord\x18\x03 \x01(\x0b\x32\n.Rectangle2E\n\nHelmet_Reg\x12\x37\n\x0fsendHelmet_Info\x12\x0e.JinYu_Request\x1a\x12.BHhelmet_Response\"\x00\x42,\n\x17\x63om.lyzh.aiservice.grpcB\x0c\x42\x65iHangProtoP\x01\x88\x01\x01\x62\x06proto3')
_JINYU_REQUEST = DESCRIPTOR.message_types_by_name['JinYu_Request']
_BHHELMET_RESPONSE = DESCRIPTOR.message_types_by_name['BHhelmet_Response']
_POINT = DESCRIPTOR.message_types_by_name['Point']
_RECTANGLE = DESCRIPTOR.message_types_by_name['Rectangle']
_HELMETINFO = DESCRIPTOR.message_types_by_name['HelmetInfo']
JinYu_Request = _reflection.GeneratedProtocolMessageType('JinYu_Request', (_message.Message,), {
'DESCRIPTOR': _JINYU_REQUEST,
'__module__': 'BeiHangGrpc_pb2'
'DESCRIPTOR' : _JINYU_REQUEST,
'__module__' : 'BeiHangGrpc_pb2'
# @@protoc_insertion_point(class_scope:JinYu_Request)
})
})
_sym_db.RegisterMessage(JinYu_Request)
BHhelmet_Response = _reflection.GeneratedProtocolMessageType('BHhelmet_Response', (_message.Message,), {
'DESCRIPTOR': _BHHELMET_RESPONSE,
'__module__': 'BeiHangGrpc_pb2'
'DESCRIPTOR' : _BHHELMET_RESPONSE,
'__module__' : 'BeiHangGrpc_pb2'
# @@protoc_insertion_point(class_scope:BHhelmet_Response)
})
})
_sym_db.RegisterMessage(BHhelmet_Response)
Point = _reflection.GeneratedProtocolMessageType('Point', (_message.Message,), {
'DESCRIPTOR': _POINT,
'__module__': 'BeiHangGrpc_pb2'
'DESCRIPTOR' : _POINT,
'__module__' : 'BeiHangGrpc_pb2'
# @@protoc_insertion_point(class_scope:Point)
})
})
_sym_db.RegisterMessage(Point)
Rectangle = _reflection.GeneratedProtocolMessageType('Rectangle', (_message.Message,), {
'DESCRIPTOR': _RECTANGLE,
'__module__': 'BeiHangGrpc_pb2'
'DESCRIPTOR' : _RECTANGLE,
'__module__' : 'BeiHangGrpc_pb2'
# @@protoc_insertion_point(class_scope:Rectangle)
})
})
_sym_db.RegisterMessage(Rectangle)
HelmetInfo = _reflection.GeneratedProtocolMessageType('HelmetInfo', (_message.Message,), {
'DESCRIPTOR': _HELMETINFO,
'__module__': 'BeiHangGrpc_pb2'
'DESCRIPTOR' : _HELMETINFO,
'__module__' : 'BeiHangGrpc_pb2'
# @@protoc_insertion_point(class_scope:HelmetInfo)
})
})
_sym_db.RegisterMessage(HelmetInfo)
_HELMET_REG = DESCRIPTOR.services_by_name['Helmet_Reg']
@ -60,16 +63,16 @@ if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'\n\027com.lyzh.aiservice.grpcB\014BeiHangProtoP\001\210\001\001'
_JINYU_REQUEST._serialized_start = 21
_JINYU_REQUEST._serialized_end = 86
_BHHELMET_RESPONSE._serialized_start = 88
_BHHELMET_RESPONSE._serialized_end = 158
_POINT._serialized_start = 160
_POINT._serialized_end = 189
_RECTANGLE._serialized_start = 191
_RECTANGLE._serialized_end = 249
_HELMETINFO._serialized_start = 251
_HELMETINFO._serialized_end = 325
_HELMET_REG._serialized_start = 327
_HELMET_REG._serialized_end = 396
_JINYU_REQUEST._serialized_start=21
_JINYU_REQUEST._serialized_end=86
_BHHELMET_RESPONSE._serialized_start=88
_BHHELMET_RESPONSE._serialized_end=158
_POINT._serialized_start=160
_POINT._serialized_end=189
_RECTANGLE._serialized_start=191
_RECTANGLE._serialized_end=249
_HELMETINFO._serialized_start=251
_HELMETINFO._serialized_end=325
_HELMET_REG._serialized_start=327
_HELMET_REG._serialized_end=396
# @@protoc_insertion_point(module_scope)

View File

@ -1,7 +1,7 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
# import BeiHangGrpc_pb2 as BeiHangGrpc__pb2
from . import BeiHangGrpc_pb2 as BeiHangGrpc__pb2
@ -43,9 +43,8 @@ def add_Helmet_RegServicer_to_server(servicer, server):
'Helmet_Reg', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class Helmet_Reg(object):
"""Missing associated documentation comment in .proto file."""

View File

@ -37,7 +37,7 @@ def analyse(ip: str, pic_url: str):
response = stub.sendHelmet_Info(request)
if response.helmetinfoList:
for i in response.helmetinfoList:
if i.head_helmet == 0: # 未戴安全帽事件成立
if i.head_helmet == 1: # 未戴安全帽事件成立
return True, response
return False, response