finish pipeline
This commit is contained in:
@@ -1,23 +1,35 @@
|
||||
import requests
|
||||
import numpy as np
|
||||
import cv2
|
||||
|
||||
|
||||
class CommunicateUtil:
|
||||
VIEW_HOST = "127.0.0.1:5000"
|
||||
INFERENCE_HOST = "127.0.0.1:5000"
|
||||
VIEW_HOST = "192.168.1.2:7999" #"10.7.250.52:7999" ##
|
||||
INFERENCE_HOST = "127.0.0.1"
|
||||
INFERENCE_PORT = 5000
|
||||
|
||||
def get_view_data(init = False) -> dict:
|
||||
params = {}
|
||||
params["create_scanner"] = init
|
||||
response = requests.get(f"http://{CommunicateUtil.VIEW_HOST}/api/data", json=params)
|
||||
data = response.json()
|
||||
|
||||
if not data["success"]:
|
||||
print(f"Failed to get view data")
|
||||
return None
|
||||
return data
|
||||
|
||||
image_id = data["image_id"]
|
||||
depth_image = np.array(data["depth_image"], dtype=np.uint16)
|
||||
depth_intrinsics = data["depth_intrinsics"]
|
||||
depth_extrinsics = np.array(data["depth_extrinsics"])
|
||||
view_data = {
|
||||
"image_id": image_id,
|
||||
"depth_image": depth_image,
|
||||
"depth_intrinsics": depth_intrinsics,
|
||||
"depth_extrinsics": depth_extrinsics
|
||||
}
|
||||
return view_data
|
||||
|
||||
def get_inference_data(view_data:dict) -> dict:
|
||||
data = {}
|
||||
return data
|
||||
|
||||
|
Reference in New Issue
Block a user