Bladeren bron

测试环境AI识别合并master代码

zhangdongming 1 jaar geleden
bovenliggende
commit
dbea05090c
4 gewijzigde bestanden met toevoegingen van 268 en 81 verwijderingen
  1. 8 0
      AnsjerPush/config.py
  2. 102 81
      Controller/AiController.py
  3. 141 0
      Object/MergePic.py
  4. 17 0
      Service/EquipmentInfoService.py

+ 8 - 0
AnsjerPush/config.py

@@ -138,6 +138,14 @@ APP_BUNDLE_DICT = {
 SYS_EVENT_TYPE_LIST = [702, 703, 704]
 MULTI_CHANNEL_TYPE_LIST = [1, 2, 3, 4, 10001]
 
+# AI识别标签
+AI_IDENTIFICATION_TAGS_DICT = {
+    '1': 'Person',
+    '2': 'Pet',
+    '3': 'Vehicle',
+    '4': 'Package'
+}
+
 EVENT_DICT_CN = {
     51: '检测到画面变化 ',
     57: '有人出现 ',

File diff suppressed because it is too large
+ 102 - 81
Controller/AiController.py


File diff suppressed because it is too large
+ 141 - 0
Object/MergePic.py


+ 17 - 0
Service/EquipmentInfoService.py

@@ -92,6 +92,23 @@ class EquipmentInfoService:
             er_log.error(repr(e))
             return False
 
+    @staticmethod
+    def randoms_insert_equipment_info(**kwargs):
+        """
+        随机一个推送数据表存储数据
+        """
+        equipment_info_list = [
+            EquipmentInfo1, EquipmentInfo2, EquipmentInfo3, EquipmentInfo4, EquipmentInfo5, EquipmentInfo6,
+            EquipmentInfo7, EquipmentInfo8, EquipmentInfo9, EquipmentInfo10,
+            EquipmentInfo11, EquipmentInfo12, EquipmentInfo13, EquipmentInfo14, EquipmentInfo15, EquipmentInfo16,
+            EquipmentInfo17, EquipmentInfo18, EquipmentInfo19, EquipmentInfo20]
+        try:
+            random_model = random.choice(equipment_info_list)
+            LOGGER.info('随机存表参数:{},表:{}'.format(kwargs, random_model))
+            random_model.objects.create(**kwargs)
+        except Exception as e:
+            LOGGER.info('随机存储推送数据异常: error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
+
     @staticmethod
     def randoms_choice_equipment_info():
         return random.choice(EQUIPMENT_INFO_LIST)

Some files were not shown because too many files changed in this diff