import gradio as gr import requests img_encode = gr.processing_utils.encode_url_or_file_to_base64("cropped.jpg") r = requests.post( url="https://hf.space/embed/AlexLach/LeakDetection/+/api/predict", json={"data": [img_encode]}, ) print(r.json()["data"][0]["confidences"][0]["label"]) print(r.json()["data"][0]["confidences"][0]["confidence"])