import base64
import requests
IMMICH_ML_URL = "http://192.168.0.108:3003/predict"
# Path to the local image file
image_path = "path"
# Read and encode the image to base64
with open(image_path, "rb") as image_file:
image_base64 = base64.b64encode(image_file.read()).decode("utf-8")
# Prepare the request payload
form_data = {
"image": image_base64,
"entries": "face-detection"
}
# Send POST request
response = requests.post(IMMICH_ML_URL, data=form_data)
# Output the result
print("Status Code:", response.status_code)
print("Response:", response.json())
import base64
import requests
IMMICH_ML_URL = "http://192.168.0.108:3003/predict"
# Path to the local image file
image_path = "path"
# Read and encode the image to base64
with open(image_path, "rb") as image_file:
image_base64 = base64.b64encode(image_file.read()).decode("utf-8")
# Prepare the request payload
form_data = {
"image": image_base64,
"entries": "face-detection"
}
# Send POST request
response = requests.post(IMMICH_ML_URL, data=form_data)
# Output the result
print("Status Code:", response.status_code)
print("Response:", response.json())