CYF200127 commited on
Commit
3dbdaf8
1 Parent(s): b291e50

Update getReaction.py

Browse files
Files changed (1) hide show
  1. getReaction.py +1 -2
getReaction.py CHANGED
@@ -11,7 +11,6 @@ model = Reaction(ckpt_path, device=torch.device('cpu'))
11
  device = torch.device('cpu')
12
 
13
  def get_reaction(image_path: str) -> list:
14
- '''Returns a list of reactions extracted from the image.'''
15
  image_file = image_path
16
  return json.dumps(model.predict_image_file(image_file, molscribe=True, ocr=True))
17
 
@@ -65,7 +64,7 @@ def generate_combined_image(predictions, image_file):
65
  ax.imshow(img)
66
  ax.axis('off')
67
  if idx < n_images:
68
- ax.set_title(f"## Reaction {idx + 1} ##",fontsize=42)
69
 
70
  # 删除多余的子图
71
  for idx in range(n_images, len(axes)):
 
11
  device = torch.device('cpu')
12
 
13
  def get_reaction(image_path: str) -> list:
 
14
  image_file = image_path
15
  return json.dumps(model.predict_image_file(image_file, molscribe=True, ocr=True))
16
 
 
64
  ax.imshow(img)
65
  ax.axis('off')
66
  if idx < n_images:
67
+ ax.set_title(f"### Reaction {idx + 1} ###",fontsize=42)
68
 
69
  # 删除多余的子图
70
  for idx in range(n_images, len(axes)):