Spaces:
Runtime error
Runtime error
heecheol.park commited on
Commit Β·
fc03749
1
Parent(s): 6f8483f
feat: support Korean text recognition in OCR
Browse files- app.py +2 -1
- packages.txt +1 -0
app.py
CHANGED
|
@@ -6,9 +6,10 @@ from PIL import Image
|
|
| 6 |
|
| 7 |
def ocr_image_to_text(image: Image.Image):
|
| 8 |
image_cv = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)
|
| 9 |
-
text = pytesseract.image_to_string(image_cv)
|
| 10 |
return text
|
| 11 |
|
|
|
|
| 12 |
# Gradio μΈν°νμ΄μ€λ₯Ό μ μν©λλ€.
|
| 13 |
image_input = gr.inputs.Image(label="Upload an image")
|
| 14 |
text_output = gr.outputs.Textbox(label="Extracted Text")
|
|
|
|
| 6 |
|
| 7 |
def ocr_image_to_text(image: Image.Image):
|
| 8 |
image_cv = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)
|
| 9 |
+
text = pytesseract.image_to_string(image_cv, lang='eng+kor')
|
| 10 |
return text
|
| 11 |
|
| 12 |
+
|
| 13 |
# Gradio μΈν°νμ΄μ€λ₯Ό μ μν©λλ€.
|
| 14 |
image_input = gr.inputs.Image(label="Upload an image")
|
| 15 |
text_output = gr.outputs.Textbox(label="Extracted Text")
|
packages.txt
CHANGED
|
@@ -1,2 +1,3 @@
|
|
| 1 |
tesseract-ocr
|
| 2 |
libtesseract-dev
|
|
|
|
|
|
| 1 |
tesseract-ocr
|
| 2 |
libtesseract-dev
|
| 3 |
+
tesseract-ocr-kor
|