You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					37 lines
				
				853 B
			
		
		
			
		
	
	
					37 lines
				
				853 B
			| 
											5 years ago
										 | #ifndef ONNXMODEL_H
 | ||
|  | #define ONNXMODEL_H
 | ||
| 
											6 years ago
										 | 
 | ||
|  | #include <stdlib.h>
 | ||
|  | #include "runmodel.h"
 | ||
|  | 
 | ||
| 
											5 years ago
										 | class ONNXModel : public RunModel {
 | ||
| 
											6 years ago
										 | public:
 | ||
| 
											5 years ago
										 |   ONNXModel(const char *path, float *output, size_t output_size, int runtime);
 | ||
|  | 	~ONNXModel();
 | ||
| 
											6 years ago
										 |   void addRecurrent(float *state, int state_size);
 | ||
|  |   void addDesire(float *state, int state_size);
 | ||
| 
											6 years ago
										 |   void addTrafficConvention(float *state, int state_size);
 | ||
| 
											6 years ago
										 |   void execute(float *net_input_buf, int buf_size);
 | ||
| 
											6 years ago
										 | private:
 | ||
| 
											6 years ago
										 |   int proc_pid;
 | ||
| 
											6 years ago
										 | 
 | ||
|  |   float *output;
 | ||
|  |   size_t output_size;
 | ||
|  | 
 | ||
|  |   float *rnn_input_buf = NULL;
 | ||
| 
											6 years ago
										 |   int rnn_state_size;
 | ||
| 
											6 years ago
										 |   float *desire_input_buf = NULL;
 | ||
| 
											6 years ago
										 |   int desire_state_size;
 | ||
| 
											6 years ago
										 |   float *traffic_convention_input_buf = NULL;
 | ||
|  |   int traffic_convention_size;
 | ||
| 
											6 years ago
										 | 
 | ||
|  |   // pipe to communicate to keras subprocess
 | ||
|  |   void pread(float *buf, int size);
 | ||
|  |   void pwrite(float *buf, int size);
 | ||
|  |   int pipein[2];
 | ||
|  |   int pipeout[2];
 | ||
| 
											6 years ago
										 | };
 | ||
|  | 
 | ||
|  | #endif
 | ||
|  | 
 |