Assumes an untrusted / web level context
(self,
hash_instances = True,
validate_label_file = True,
overwrite_existing_instances = False)
| 1041 | return True |
| 1042 | |
| 1043 | def update_instance_list(self, |
| 1044 | hash_instances = True, |
| 1045 | validate_label_file = True, |
| 1046 | overwrite_existing_instances = False): |
| 1047 | """ |
| 1048 | Assumes an untrusted / web level context |
| 1049 | """ |
| 1050 | |
| 1051 | spec_list_cuboid_face = [ |
| 1052 | {'bot_left': { |
| 1053 | 'kind': dict |
| 1054 | } |
| 1055 | }, |
| 1056 | {'bot_right': { |
| 1057 | 'kind': dict |
| 1058 | } |
| 1059 | }, |
| 1060 | {'top_left': { |
| 1061 | 'kind': dict |
| 1062 | } |
| 1063 | }, |
| 1064 | {'top_right': { |
| 1065 | 'kind': dict |
| 1066 | } |
| 1067 | }, |
| 1068 | ] |
| 1069 | |
| 1070 | cleaned_instance_list = self.instance_list_new |
| 1071 | try: |
| 1072 | cleaned_instance_list = self.__identify_and_merge_duplicate_ids(self.instance_list_new) |
| 1073 | except Exception as exception: |
| 1074 | logger.warning(f"{str(exception)}_trace_4f36a2aa") |
| 1075 | communicate_via_email.send(settings.DEFAULT_ENGINEERING_EMAIL, |
| 1076 | '[Exception] Duplicate ID On Annotation_Update', str(self.log)) |
| 1077 | valid_models = self.check_allowed_model_ids(cleaned_instance_list) |
| 1078 | valid_runs = self.check_allowed_model_run_ids(cleaned_instance_list) |
| 1079 | if not valid_models or not valid_runs: |
| 1080 | return False |
| 1081 | for instance_proposed in cleaned_instance_list: |
| 1082 | # For other checks that are specific to |
| 1083 | # to certain instance types |
| 1084 | self.instance_proposed = instance_proposed |
| 1085 | if self.instance_proposed['type'] == 'relation': |
| 1086 | for elm in self.per_instance_spec_list: |
| 1087 | if 'label_file_id' in elm: |
| 1088 | elm['label_file_id']['required'] = False |
| 1089 | |
| 1090 | if self.instance_proposed.get('type') == 'global': |
| 1091 | self.instance_proposed['label_file_id'] = -1 # to bypass input type check |
| 1092 | |
| 1093 | self.log, input = regular_input.input_check_many( |
| 1094 | spec_list = self.per_instance_spec_list, |
| 1095 | log = self.log, |
| 1096 | untrusted_input = instance_proposed) |
| 1097 | |
| 1098 | if len(self.log["error"].keys()) >= 1: |
| 1099 | return False |
| 1100 |
no test coverage detected