Feeding in Neural Network output into UE

Hello, I’m a complete beginner with UE and trying to learn/use it for a project at uni. Basically I’m trying to figure out how to feed in the output from a neural network (run locally) into UE such that it will trigger a character’s actions. For example, if the NN outputs ‘wave’ I want to make the character in UE wave its hand. If anyone has any good ideas how to make this happen or any recs for resources etc. I’d be delighted.

Also, I’m already able to run the NN locally (tensorflow implementation) and generate output, hence I’m unsure whether I need to use the NN plugin or whether I can simply route the output into UE somehow.

@quant.furs You could try linking your project with unreal through socket communication.
TCP/IP would probably the most reliable, you probably don’t need the speed of UDP and packet loss would cause problems.

There is a free TCP Socket Plugin on the marketplace.

@3dRaven Thank you for the reply. Ok, I’m rather unfamiliar with TCP/IP etc, but I’ll try google for some resources about socket communication and UE.

In essence, do you think the TCP socket plugin would allow me to simply run my ML model on my machine, have the model output text commands that somehow gets routed into UE’s blueprints, which can then be set up to trigger character animations? I.e. I don’t need this to run over any internet/remote/network connections, but I can handle it all on a single machine.

@quant.furs It should be adequate to pass information. What programming language is your ML algorithm based in?

@3dRaven Perfect. I’m in python.

Seems there is a built in lib for it

Should be pretty straightforward to implement

Fantastic, I’ll trawl through it. Would you say this might help on the UE side to receive input? TCP Socket Listener, Receive Binary Data From an IP/Port Into UE4, (Full Code Sample) | Unreal Engine Community Wiki

or perhaps the socket plugin could handle this for me already.

Yes it seems to directly use socket modules. Though I’m guessing the plugin does the same just in packaged bp form.

Ok great, I’ll give it a try and see if I can make it work. Thank you very much for your help.