File size: 765 Bytes
132787d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import requests

# Path to your image
image_path = "/Users/wjm55/yale/weaviate-test/yolov11_output/valid/images/Paris_BnF_Velins_611_00003.jpg"

# Open the image file
with open(image_path, 'rb') as f:
    # Create the files parameter for the POST request
    files = {'image': f}
    
    # Optional parameters (using defaults from the API)
    params = {
        'model_id': 'YOLOv11-XLarge',  # default model
        'conf': 0.25,                   # confidence threshold
        'iou': 0.7                      # IoU threshold
    }

    # Send POST request to the endpoint
    response = requests.post('http://localhost:7860/predict', 
                           files=files,
                           params=params)

# Print the results
print(response.json())