23 lines
601 B
Python
23 lines
601 B
Python
import requests
|
|
import numpy as np
|
|
import cv2
|
|
|
|
|
|
class CommunicateUtil:
|
|
VIEW_HOST = "127.0.0.1:5000"
|
|
INFERENCE_HOST = "127.0.0.1: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
|
|
|
|
def get_inference_data(view_data:dict) -> dict:
|
|
data = {}
|
|
return data
|
|
|