Team Ai
Apppublic

UNIQ-DEV/Image-Classification-Benchmark

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes
extract.py10 linesDownload Raw Back to util
1import re2 3def extract_image_urls(text):4    # Regular expression to match image URLs5    pattern = re.compile(r'https?://[^\s]+\.jpg|https?://[^\s]+\.jpeg|https?://[^\s]+\.png|https?://[^\s]+\.gif|https?://[^\s]+\.bmp|https?://[^\s]+\.webp')6 7    # Find all matches in the input text8    matches = pattern.findall(text)9 10    return matches