Skip to content
Permalink
240cc527d1
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
31 lines (25 sloc) 820 Bytes
import io
import zmq
from PIL import Image
from main import *
# NOTE: Code snippet from Tensorflow2UnityTest, by Rotolonico
# Any changed will be noted.
if __name__ == '__main__':
context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://*:5555")
print("client setup!")
initialise_model()
print("Model ready!")
while True:
# wait for next request from client
bytes_received = socket.recv()
print(0)
# print(len(bytes_received))
results = posePredictionTFLite(bytes_received)
#CHANGED: from a 4D array to a 2D array
results = np.resize(results, (17, 3))
bytes_to_send = results.tobytes()
# image = Image.open(io.BytesIO(bytes_received))
socket.send(bytes_to_send)
print(1)