[Fix] Use yaml.safe_load instead of load (#753)

pull/757/head
Tong Gao 2022-01-26 14:29:30 +08:00 committed by GitHub
parent 976b976e4a
commit 218f9f08d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -180,7 +180,7 @@ def process_line(line, contours, words):
ann_dict = re.sub('([0-9]) +([ 0-9])', r'\1,\2', ann_dict)
ann_dict = re.sub('([0-9]) -([0-9])', r'\1,-\2', ann_dict)
ann_dict = ann_dict.replace("[u',']", "[u'#']")
ann_dict = yaml.load(ann_dict)
ann_dict = yaml.safe_load(ann_dict)
X = np.array([ann_dict['x']])
Y = np.array([ann_dict['y']])

View File

@ -169,7 +169,7 @@ def process_line(line, contours, words):
ann_dict = re.sub('([0-9]) +([ 0-9])', r'\1,\2', ann_dict)
ann_dict = re.sub('([0-9]) -([0-9])', r'\1,-\2', ann_dict)
ann_dict = ann_dict.replace("[u',']", "[u'#']")
ann_dict = yaml.load(ann_dict)
ann_dict = yaml.safe_load(ann_dict)
X = np.array([ann_dict['x']])
Y = np.array([ann_dict['y']])