+def shelf_inventry(video_capture, camera_info):
+ """
+ 人脸识别
+ """
+ global count
+ labels = "bottles"
+ process_this_frame = 0
+ while True:
+ success, frame = video_capture.get_frame()
+ if not success:
+ break
+ if process_this_frame == 0:
+ url = config.detection_url + "/v1/obj_detection/detect"
+ # info1 = cv2.imencode(".jpg", rgb_small_frame)[1].tobytes()
+ data = json.loads(requests.post(url, data=frame,
+ verify=config.ssl_cacertpath).text)
+ inven_info = inventry_info()
+ current_count = data[count]
+ labels = data[labels]
+ total_count = inven_info.current_count + inven_info.total_count
+ inven_info.setcurrentcount(current_count)
+ inven_info.settotalcount(total_count)
+ inven_info.setlabel(labels)
+ inven_info.utime = time.time()
+ store_data(inven_info)
+
+
+def store_info_db(inven_info):
+ """
+ Send "shelf" data to InfluxDB