2. 历史事件上报

功能描述

上报所有事件(数据库保存所有Event字段)给云平台。需要和监控服务器约定url,假设/EventServer/api/HistoryEvent

调用URL

调用方法: POST

参数描述(JSON格式):

返回信息:

{
	'score': 0.16, 
	'reg_pic': 'xxx', 
	'group_name': 'default_group', 
	'identity_id': '13028', 
	'identity_name': 'stranger', 
    "want_action":"0",
	'timestamp': 1560408984678, 
	'ext_data': {
			'device_type': '1', 
			'grab_fiqa_info': {   //臻识抓拍机返回的信息
					'confidence': 90, 
					'face_id': 1381, 
					'rect': {'top': 420, 'bottom': 524, 'right': 1734, 'left': 1652}, 
					'pitch': 0, 
					'age': 4, 
					'rel_rect': {'top': 62, 'bottom': 166, 'right': 134, 'left': 52}, 
					'yaw': 0, 
					'eye_dist': 82, 
					'roll': 0, 
					'sex': 1}, //性别0为男, 1为女
			'spot_pic': 'xxxxx', 
        	'recognize_face':"xxx",
			'box_fiqa_info': {   //AI BOX端返回的图片质量检测信息
					'age':4,
					'sex':1, //性别0为男,1为女
					'info': {'face_size': 255.0, 
                   'clarity': 1.285613331998212, 
                   'headpose': {'roll_angle': 10.107, 'pitch_angle': 14.413, 'yaw_angle': 7.326},
                   'partial': False, 
                   'brightness': 0.8362176798557405},  //图片质量检测的参数
					'fiqa_result': True,    //fiqa是否合格的标志,True表示图片质量比较好
					'success': ['face_size', 'clarity', 'headpose', 'partial', 'brightness'], 
					'fails': []}, 
			'person_type': 1,   //通过此处的人员类型来判断是否是陌生人,如果是person_type为4, 则是陌生人,且fiqa_result为False,则说明陌生人的图片质量不是很好,不能进行再次下发注册
			 'device_ip': '192.168.1.151'}
}

示例:

可以使用小盒子附带的server来获取上传的事件。

假设小盒子的ip为:192.168.1.19,接收的resetful api为HistoryEvent ,端口号为9528。

那webui或是配置/修改历史事件上报接收服务器地址信息为:http://192.168.1.19:9528/HistoryEvent

启动server方法:

$ sudo -i
\# cd /system/data/sophon_gate/script
\# python3 Event_Receive_server.py
* Serving Flask app "Event_Receive_server" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://0.0.0.0:9528/ (Press CTRL+C to quit)

Last updated