Spaces:
Sleeping
Sleeping
BilalHasan
commited on
Commit
•
b314edd
1
Parent(s):
aff689d
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,11 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
def preprocess_image(image):
|
3 |
gray_image = cv.cvtColor(image, cv.COLOR_BGR2GRAY)
|
4 |
ret, bin_image = cv.threshold(gray_image, 127, 255, cv.THRESH_OTSU)
|
|
|
1 |
+
import cv2 as cv
|
2 |
+
import matplotlib.pyplot as plt
|
3 |
+
from transformers import TrOCRProcessor, VisionEncoderDecoderModel
|
4 |
+
import numpy as np
|
5 |
+
from concurrent.futures import ProcessPoolExecutor
|
6 |
+
from openai import OpenAI
|
7 |
+
|
8 |
+
|
9 |
def preprocess_image(image):
|
10 |
gray_image = cv.cvtColor(image, cv.COLOR_BGR2GRAY)
|
11 |
ret, bin_image = cv.threshold(gray_image, 127, 255, cv.THRESH_OTSU)
|