def ocrToDict(image=None, listofwords=[]):
#image can be a list of files
Words = {}
if len(listofwords) == 0:
PrintFail('You need to input a list of words')
if 'y' in str(raw_input("Do you want to search for lyrics now? ")).lower():
artist = raw_input("Artist: ")
song = raw_input("Song: ")
listofwords = GrabSongLyrics(artist, song)
print(listofwords)
else:
return
if isinstance(image, list) == False:
image = PromptList('Which image/images to Scan: ', image)
for i, image in enumerate(image):
Words['Clean'][i] = imageToOCR(image, listofwords)
with open('{}Transcript.json'.format(Words[1]), 'w') as f:
json.dump(Words, f)
评论列表
文章目录