This commit is contained in:
Kadir 2024-08-25 09:50:41 +02:00
parent 6d343e52e7
commit 2e94bda7fa

View file

@ -17,9 +17,9 @@ def inference(image_path):
return output, predictions
def extract_total_sqm(deplot_input_str):
def extract_total_sqm(input_str: str):
sqmregex = r"(\d+\.\d*) ?(sq ?m|sq. ?m)"
matches = re.findall(sqmregex, deplot_input_str.lower())
matches = re.findall(sqmregex, input_str.lower())
if len(matches) == 0:
return None
sqms = [float(m[0]) for m in matches]