File size: 579 Bytes
6517bcc
b5c39fd
6517bcc
b626bbe
6517bcc
b626bbe
b5c39fd
6517bcc
 
 
 
 
 
b5c39fd
 
 
6517bcc
b5c39fd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import requests
import time

url = "https://lord-reso-scene-understanding.hf.space/generate-text/"
description = "Describe this image highlighting the positions of the objects. Use simple English words."
file_path = "assets/room.jpg"
start_time = time.time()

with open(file_path, "rb") as image_file:
    files = {"file": image_file}
    data = {"description": description}
    response = requests.post(url, files=files, data=data)

end_time = time.time()
elapsed_time = end_time - start_time

print(response.json())
print(f"Request execution time: {elapsed_time:.2f} seconds")