prediction-challenge predictor application
The client will use on_env to store the historical trajectory (10 frames) sent by the simulator, and use fetch_my_state to get the predicted results (30 frames).
In the ./predictor/*,
predictor.pyis an abstract class, you need to implement all the abstract methods in your own predictor.echo_predictor.pyis a simple echo predictor, namely returns back the last frame in the historical trajectory.lstm_predictor.pyis a pytorch-based predictor which is trained on theinteractiondataset and has 0.3 MoN performance on the MA scenario.lstm.ptstores the model parameters.
-
python 3.7
-
docker
-
grpc && protobuf
-
please follow the instruction in the
simulator/readme.md -
pip install grpcio pip install protobuf
-
-
pytorch or tensorflow to support your predictor.
Prepare
use protoc to generate python version protocols for communication.
each time the simulator.proto updated, you need generate them again.
protoc -I ../proto/ --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_python_plugin` ../proto/simulator.proto
protoc -I ../proto/ --python_out=. ../proto/simulator.protoIf this fails, you can try
python -m grpc_tools.protoc --proto_path=../proto/ --python_out=. --grpc_python_out=. ../proto/simulator.protoYou may get a warning when using grpc_tools.protoc, but it should still execute succesfully and generate the simulator_pb2.py and simulator_pb2_grpc files (provided that you have grpc_tools installed).
Run locally
# simulator should be launched before predictor, where
# -s sepcify the simulator service address
# -p specify the simulator service port
python3 main.py -s 127.0.0.1 -p 50051Docker
- You need to put the dependencies (pytorch, numpy, ....) in the
requirement.text, then
cd deploy
./make_image.sh my_predictor