width, height, and file_id to int

This commit is contained in:
David PAGNON 2024-11-07 11:20:52 +01:00 committed by GitHub
parent eba8cf4ab0
commit de5342e51d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -305,11 +305,11 @@ def dataset_to_mmpose2d(coords_df, mmpose_json_file, img_size, markerset='custom
file_name = coords_df.index[i]
w, h = img_size
# id from concatenation of numbers from path
file_id = ''.join(re.findall(r'\d+', str(file_name)))
file_id = int(''.join(re.findall(r'\d+', str(file_name))))
labels2d_json_data['images'] += [{'file_name': file_name,
'height': str(h),
'width': str(w),
'height': h,
'width': w,
'id': file_id,
'license': 1}]