22 lines
682 B
Python
Executable File
22 lines
682 B
Python
Executable File
import requests
|
|
import base64
|
|
|
|
|
|
BASE_URL = 'http://bilioso.isti.cnr.it:8190/bcir/'
|
|
|
|
image_path = '/home/paolo/Dropbox/extension_logs/352998a9ee4f490b9a56f84d05983168.png_90.jpg'
|
|
|
|
#searchByImg
|
|
files = {'image': ('query', open(image_path, 'rb'))}
|
|
post_data = {'securityID': 'A6mMmeWZ8JjWKz5', 'orientation': "1"}
|
|
|
|
r = requests.post(BASE_URL + 'searchByImg', files=files, data=post_data)
|
|
print(r.json())
|
|
|
|
with open(image_path, "rb") as image_file:
|
|
base64_img = base64.b64encode(image_file.read())
|
|
base64_data = {'image': base64_img, 'securityID': 'FA6mMmeWZ8JjWKz5', 'orientation': "8"}
|
|
|
|
r = requests.post(BASE_URL + 'searchByImgB64', data=base64_data)
|
|
print(r.json())
|