Created
January 18, 2021 19:44
-
-
Save godfather68/43a42043d9569d777b437470ced61ecd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytesseract # ======= > Add | |
try: | |
from PIL import Image | |
except: | |
import Image | |
# Create your views here. | |
class HomeView(FormView): | |
form_class = UploadForm | |
template_name = 'index.html' | |
success_url = '/' | |
def form_valid(self, form): | |
upload = self.request.FILES['file'] | |
print(type(pytesseract.image_to_string(Image.open(upload)))) # =====> add line | |
return super().form_valid(form) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment