File size: 203 Bytes
de0beca
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
import pytesseract
import re

def extract_weight_from_image(image):
text = pytesseract.image_to_string(image)
match = re.search(r"\d+.\d{2}", text)
if match:
return match.group()
return "No weight found"