license
This commit is contained in:
parent
267b73c579
commit
5daf137e8c
@ -32,7 +32,11 @@ def face_detection(image):
|
|||||||
"image": img_base64
|
"image": img_base64
|
||||||
}
|
}
|
||||||
|
|
||||||
response = requests.post(api_url, json=payload)
|
headers = {
|
||||||
|
"Authorization": f"Bearer {api_access_key}"
|
||||||
|
}
|
||||||
|
|
||||||
|
response = requests.post(api_url, json=payload, headers=headers)
|
||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
result = response.json()
|
result = response.json()
|
||||||
@ -55,7 +59,7 @@ def image_callback(msg):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
global api_url, pub
|
global api_url, api_access_key, pub
|
||||||
|
|
||||||
config_file_path = os.path.join(os.path.dirname(__file__), '../config/configs.json')
|
config_file_path = os.path.join(os.path.dirname(__file__), '../config/configs.json')
|
||||||
|
|
||||||
@ -67,6 +71,7 @@ def main():
|
|||||||
config = json.load(config_file)
|
config = json.load(config_file)
|
||||||
url = config['url']
|
url = config['url']
|
||||||
endpoint_path = config['endpoint_path']["face_detection"]
|
endpoint_path = config['endpoint_path']["face_detection"]
|
||||||
|
api_access_key = config["Bellande_Framework_Access_Key"]
|
||||||
|
|
||||||
# Initialize ROS node
|
# Initialize ROS node
|
||||||
if ros_version == "1":
|
if ros_version == "1":
|
||||||
|
@ -34,7 +34,11 @@ def predict(image):
|
|||||||
"image": img_base64
|
"image": img_base64
|
||||||
}
|
}
|
||||||
|
|
||||||
response = requests.post(api_url, json=payload)
|
headers = {
|
||||||
|
"Authorization": f"Bearer {api_access_key}"
|
||||||
|
}
|
||||||
|
|
||||||
|
response = requests.post(api_url, json=payload, headers=headers)
|
||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
result = response.json()
|
result = response.json()
|
||||||
@ -67,6 +71,7 @@ def main():
|
|||||||
config = json.load(config_file)
|
config = json.load(config_file)
|
||||||
url = config['url']
|
url = config['url']
|
||||||
endpoint_path = config['endpoint_path']["prediction"]
|
endpoint_path = config['endpoint_path']["prediction"]
|
||||||
|
api_access_key = config["Bellande_Framework_Access_Key"]
|
||||||
|
|
||||||
# Initialize ROS node
|
# Initialize ROS node
|
||||||
if ros_version == "1":
|
if ros_version == "1":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user