jbilcke-hf commited on
Commit
4617222
·
1 Parent(s): c2b3ca9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -81,12 +81,12 @@ lama_cleaner_model= None
81
  ram_model = None
82
 
83
  def parse_label_and_score(string):
84
- match = re.match(r'([a-z]+)\(([0-9\.]+)\)', string)
85
  if match:
86
  label, score = match.groups()
87
  return label, float(score)
88
  else:
89
- return None
90
 
91
  def get_sam_vit_h_4b8939():
92
  if not os.path.exists('./sam_vit_h_4b8939.pth'):
 
81
  ram_model = None
82
 
83
  def parse_label_and_score(string):
84
+ match = re.match(r'(.+)\(([0-9\.]+)\)', string)
85
  if match:
86
  label, score = match.groups()
87
  return label, float(score)
88
  else:
89
+ return string, float(0.5)
90
 
91
  def get_sam_vit_h_4b8939():
92
  if not os.path.exists('./sam_vit_h_4b8939.pth'):