Files
StarPilot/selfdrive/modeld/runners/onnxmodel.h
T
ZwX1616 cd2a98aa11 fullframe DM model (#24860)
* Revert "put cereal on master"

This reverts commit 4646c132bae7358079c9b2867725f8382906c1e5.

* Revert "Revert fullframe DM model (#24812)"

This reverts commit 59e8af4c3101785cead69a9880cc03e0a18081e1.

* revert revert cereal

* clip6

* 0.8 is fair

* Fiction compensation should be based on error

* Update refs

* Add deadzone

* not that

* good mg

* ref

* ref

* ee8f

* minor tweak

* ref

* recompile

* ref

* cereal

* match driverstatus

* new ref

* new ref

* pass token through jenkins credentials

* quote

* fix snpe dead weights

* final ref

Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 1f2f9ea9c9dc37bdea9c6e32e4cb8f88ea0a34bf
2022-06-20 16:24:51 -07:00

46 lines
1.2 KiB
C++

#pragma once
#include <cstdlib>
#include "selfdrive/modeld/runners/runmodel.h"
class ONNXModel : public RunModel {
public:
ONNXModel(const char *path, float *output, size_t output_size, int runtime, bool use_extra = false, bool _use_tf8 = false);
~ONNXModel();
void addRecurrent(float *state, int state_size);
void addDesire(float *state, int state_size);
void addTrafficConvention(float *state, int state_size);
void addCalib(float *state, int state_size);
void addImage(float *image_buf, int buf_size);
void addExtra(float *image_buf, int buf_size);
void execute();
private:
int proc_pid;
float *output;
size_t output_size;
float *rnn_input_buf = NULL;
int rnn_state_size;
float *desire_input_buf = NULL;
int desire_state_size;
float *traffic_convention_input_buf = NULL;
int traffic_convention_size;
float *calib_input_buf = NULL;
int calib_size;
float *image_input_buf = NULL;
int image_buf_size;
bool use_tf8;
float *extra_input_buf = NULL;
int extra_buf_size;
bool use_extra;
// pipe to communicate to keras subprocess
void pread(float *buf, int size);
void pwrite(float *buf, int size);
int pipein[2];
int pipeout[2];
};