Skip to content

Instantly share code, notes, and snippets.

View reallymemorable's full-sized avatar

reallymemorable reallymemorable

View GitHub Profile
import Head from 'next/head'
import Image from 'next/image'
import { Inter } from '@next/font/google'
import styles from '../styles/Home.module.css'
import Link from 'next/link';
import React from 'react';
import VideoBackground from './VideoBackground';
const inter = Inter({ subsets: ['latin'] })
flask
Pillow==9.2.0
pytesseract
web: gunicorn entrypoint:app
# Import Flask and any other necessary modules at the top of the file
from flask import Flask, request, jsonify
import ocr
from PIL import Image
app = Flask(__name__)
@app.route('/process_image', methods=['POST'])
def process_image():
from PIL import Image
import pytesseract
import sys
def process(image_file):
# If you don't have tesseract executable in your PATH, include the following:
# pytesseract.pytesseract.tesseract_cmd = r'/opt/homebrew/bin/tesseract'
pytesseract.pytesseract.tesseract_cmd = 'tesseract'
# Example tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract'
from PIL import Image
import pytesseract
import sys
def process(image_file):
# If you don't have tesseract executable in your PATH, include the following:
# pytesseract.pytesseract.tesseract_cmd = r'/opt/homebrew/bin/tesseract'
pytesseract.pytesseract.tesseract_cmd = 'tesseract'
# Example tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract'
from PIL import Image
import pytesseract
import sys
def process(image_file):
# If you don't have tesseract executable in your PATH, include the following:
# pytesseract.pytesseract.tesseract_cmd = r'/opt/homebrew/bin/tesseract'
pytesseract.pytesseract.tesseract_cmd
# Example tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract'
% curl -X POST -H "Content-Type: multipart/form-data" -F "image=@/Users/reallymemorable/git/myapp/receipt1.jpg" https://myapp.herokuapp.com/process_image
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<title>Application Error</title>
<style media="screen">
html,body,iframe {
margin: 0;
from PIL import Image
import pytesseract
import sys
def process(image_file):
# If you don't have tesseract executable in your PATH, include the following:
pytesseract.pytesseract.tesseract_cmd = r'/opt/homebrew/bin/tesseract'
# Example tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract'
function startAndHide() {
// update();
Tone.Transport.start();
document.getElementById('start').style.display = 'none';
}
The HTML: