Cyril666 commited on
Commit
3966065
·
1 Parent(s): 269312a

First model version

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. det_demo.py +1 -1
app.py CHANGED
@@ -22,7 +22,7 @@ import torch
22
  def infer(filepath):
23
  config = Config('configs/rec/train_abinet.yaml')
24
  config.model_vision_checkpoint = None
25
- model = get_model(config)
26
  model = load(model, 'workdir/train-abinet/best-train-abinet.pth')
27
  charset = CharsetMapper(filename=config.dataset_charset_path, max_length=config.dataset_max_length + 1)
28
 
 
22
  def infer(filepath):
23
  config = Config('configs/rec/train_abinet.yaml')
24
  config.model_vision_checkpoint = None
25
+ model = get_model(config).to_device('cuda')
26
  model = load(model, 'workdir/train-abinet/best-train-abinet.pth')
27
  charset = CharsetMapper(filename=config.dataset_charset_path, max_length=config.dataset_max_length + 1)
28
 
det_demo.py CHANGED
@@ -580,7 +580,7 @@ class DetDemo(object):
580
  green[...,2] = 0
581
  for mask, word, box in zip(masks, words, boxes):
582
  image[mask] = image[mask] * 0.5 + green[mask] * 0.5
583
- cv2.putText(image, word, (box[0], box[1]), cv2.FONT_HERSHEY_COMPLEX, 0.4, (0,0,255), 1)
584
  '''
585
  for box in boxes:
586
  cv2.rectangle(image,(box[0], box[1]), (box[2], box[3]), (0,0,255), 2)
 
580
  green[...,2] = 0
581
  for mask, word, box in zip(masks, words, boxes):
582
  image[mask] = image[mask] * 0.5 + green[mask] * 0.5
583
+ cv2.putText(image, word, (box[0], box[1]), cv2.FONT_HERSHEY_COMPLEX, 0.6, (0,0,255), 1)
584
  '''
585
  for box in boxes:
586
  cv2.rectangle(image,(box[0], box[1]), (box[2], box[3]), (0,0,255), 2)