7eu7d7 commited on
Commit
75f5c93
·
1 Parent(s): 5962bdc
Files changed (2) hide show
  1. app.py +1 -1
  2. cap.py +2 -2
app.py CHANGED
@@ -32,7 +32,7 @@ def process_image(image):
32
  else:
33
  img = image.convert('RGB')
34
 
35
- predictor = load_predictor('captcha-2000.safetensors')
36
  text = predictor.pred_img(img, show=False)
37
  return text
38
 
 
32
  else:
33
  img = image.convert('RGB')
34
 
35
+ predictor = load_predictor('captcha-7400.safetensors')
36
  text = predictor.pred_img(img, show=False)
37
  return text
38
 
cap.py CHANGED
@@ -10,11 +10,11 @@ from PIL import Image
10
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
11
 
12
  char_dict = '_0123456789abcdefghijklmnopqrstuvwxyz'
13
- id_chr_map = {i: c for i, c in enumerate(char_dict)}
14
 
15
 
16
  class Predictor:
17
- def __init__(self, model_path, char_dict=char_dict):
18
  self.model = ResnetEncoderDecoder(char_dict).to(device)
19
  self.model.eval()
20
  if str(device)=='cpu':
 
10
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
11
 
12
  char_dict = '_0123456789abcdefghijklmnopqrstuvwxyz'
13
+ char_dict_pp = '_0123456789abcdefghijklmnopqrstuvwxyz()+-*/='
14
 
15
 
16
  class Predictor:
17
+ def __init__(self, model_path, char_dict=char_dict_pp):
18
  self.model = ResnetEncoderDecoder(char_dict).to(device)
19
  self.model.eval()
20
  if str(device)=='cpu':