mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-06 00:36:32 +08:00
e333e4f189
* cleanup include path
* continue
* format includes
* fix testraw.cc
* remove include path from SConstruct
* regroup
* rebase master
* almost done
* apply review
* rename FileReader.xx to filereader.xx
* rename Unlogger.x->unlogger.x
* rename FrameReader.xx -> framereader.xx
* apply reviews
* ui.h
* continue
* fix framebuffer.cc build error:mv util.h up
* full path to msm_media_info
* fix qcom2 camerad
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 7222d0f20d
35 lines
844 B
C++
35 lines
844 B
C++
#pragma once
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "selfdrive/modeld/runners/runmodel.h"
|
|
|
|
class ONNXModel : public RunModel {
|
|
public:
|
|
ONNXModel(const char *path, float *output, size_t output_size, int runtime);
|
|
~ONNXModel();
|
|
void addRecurrent(float *state, int state_size);
|
|
void addDesire(float *state, int state_size);
|
|
void addTrafficConvention(float *state, int state_size);
|
|
void execute(float *net_input_buf, int buf_size);
|
|
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;
|
|
|
|
// pipe to communicate to keras subprocess
|
|
void pread(float *buf, int size);
|
|
void pwrite(float *buf, int size);
|
|
int pipein[2];
|
|
int pipeout[2];
|
|
};
|
|
|