muddokon commited on
Commit
4fcbda4
·
verified ·
1 Parent(s): 46b5fd7

Update app.py

Browse files

Removed PIL pre-processing

Files changed (1) hide show
  1. app.py +4 -3
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)