Spaces:
Running
Running
Update app.py
Browse filesRemoved PIL pre-processing
app.py
CHANGED
@@ -4,11 +4,12 @@ import torch
|
|
4 |
from PIL import Image
|
5 |
|
6 |
def recognize_captcha(input, mdl):
|
|
|
7 |
# Load image
|
8 |
-
image = Image.open(input).convert("RGB")
|
9 |
# Create white background
|
10 |
-
background = Image.new("RGBA", image.size, (255, 255, 255))
|
11 |
-
combined = Image.alpha_composite(background, image).convert("RGB")
|
12 |
|
13 |
# Load model and processor
|
14 |
processor = TrOCRProcessor.from_pretrained(mdl)
|
|
|
4 |
from PIL import Image
|
5 |
|
6 |
def recognize_captcha(input, mdl):
|
7 |
+
|
8 |
# Load image
|
9 |
+
# image = Image.open(input).convert("RGB")
|
10 |
# Create white background
|
11 |
+
# background = Image.new("RGBA", image.size, (255, 255, 255))
|
12 |
+
# combined = Image.alpha_composite(background, image).convert("RGB")
|
13 |
|
14 |
# Load model and processor
|
15 |
processor = TrOCRProcessor.from_pretrained(mdl)
|