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.
		
		
		
		
			
				
					45 lines
				
				1016 B
			
		
		
			
		
	
	
					45 lines
				
				1016 B
			| 
								 
											6 years ago
										 
									 | 
							
								#ifndef DMONITORING_H
							 | 
						||
| 
								 | 
							
								#define DMONITORING_H
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								#include "common/util.h"
							 | 
						||
| 
								 | 
							
								#include "commonmodel.h"
							 | 
						||
| 
								 | 
							
								#include "runners/run.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include "cereal/gen/cpp/log.capnp.h"
							 | 
						||
| 
								 | 
							
								#include <capnp/serialize.h>
							 | 
						||
| 
								 | 
							
								#include "messaging.hpp"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								extern "C" {
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define OUTPUT_SIZE 33
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								typedef struct DMonitoringResult {
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								  float face_orientation[3];
							 | 
						||
| 
								 | 
							
								  float face_orientation_meta[3];
							 | 
						||
| 
								 | 
							
								  float face_position[2];
							 | 
						||
| 
								 | 
							
								  float face_position_meta[2];
							 | 
						||
| 
								 | 
							
								  float face_prob;
							 | 
						||
| 
								 | 
							
								  float left_eye_prob;
							 | 
						||
| 
								 | 
							
								  float right_eye_prob;
							 | 
						||
| 
								 | 
							
								  float left_blink_prob;
							 | 
						||
| 
								 | 
							
								  float right_blink_prob;
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								} DMonitoringResult;
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								typedef struct DMonitoringModelState {
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								  RunModel *m;
							 | 
						||
| 
								 | 
							
								  float output[OUTPUT_SIZE];
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								} DMonitoringModelState;
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								void dmonitoring_init(DMonitoringModelState* s);
							 | 
						||
| 
								 | 
							
								DMonitoringResult dmonitoring_eval_frame(DMonitoringModelState* s, void* stream_buf, int width, int height);
							 | 
						||
| 
								 | 
							
								void dmonitoring_publish(PubSocket *sock, uint32_t frame_id, const DMonitoringResult res);
							 | 
						||
| 
								 | 
							
								void dmonitoring_free(DMonitoringModelState* s);
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif
							 |