def __check_shape_files(self, prefix, postfix, index):
"""Return the file path of the image and annotation file (or empty string).
:param prefix: (str) The prefix (identifier) of the hands set
:param postfix: (str) The postfix of the hands set
:param index: (int) The index of the shape files
:return: (tuple[str, str]) The file path of the image and sights annotation
Empty string if the doesn't exist
"""
img_file_path = ''
annotation_file_path = ''
files_name = '{0}_{1}{2}'
files_path1 = os.path.join(paths.resources, 'cuedspeech', files_name.format(prefix, index, ''))
files_path2 = os.path.join(paths.resources, 'cuedspeech', files_name.format(prefix, index, postfix))
for extension in image_extensions:
if os.path.exists(files_path1 + extension):
img_file_path = files_path1 + extension
break
if os.path.exists(files_path2 + '.xra'):
annotation_file_path = files_path2 + '.xra'
elif os.path.exists(files_path2 + '.csv'):
annotation_file_path = files_path2 + '.csv'
return (img_file_path, annotation_file_path)