Spaces:
Runtime error
Runtime error
import easyocr | |
reader = easyocr.Reader(['en']) | |
def classifyCNNImage(image): | |
classes = ["confederate", "swastika", "gun", "kkk", "noose"] | |
textExtract = reader.readtext(image, detail = 0) | |
fullText = "" | |
for i in range(len(textExtract)): | |
fullText += textExtract[i] | |
fullText = fullText.lower() | |
for j in range(len(classes)): | |
if classes[j] in fullText: | |
return True | |
return False |