work for beta festival 2024
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.
 
 
 

87 lines
1.7 KiB

#pragma once
#include "ofMain.h"
#include <onnxruntime_cxx_api.h>
#include "ofxOpenCv.h"
#include "Onnx.h"
#include "Yolo.h"
#include <vector>
#include "Player.h"
#include "Map.h"
#include <chrono>
#include <iostream>
#include "ModelThread.h"
#include "Server.h"
#include "Request.h"
// #include "ofxPiMapper.h"
class ofApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void keyPressed(int key);
void keyReleased(int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased(int x, int y, int button);
void mouseEntered(int x, int y);
void mouseExited(int x, int y);
void windowResized(int w, int h);
void dragEvent(ofDragInfo dragInfo);
void gotMessage(ofMessage msg);
void inferEmotionalState();
void renderDepthMap();
void printEmotions();
void displayFrame();
float window_height;
float window_width;
ofImage img;
cv::Mat cvImg;
ofVideoGrabber webcam;
Player player;
bool firstRun = true;
Onnx depth;
Onnx depth_small;
Onnx yolo;
Onnx emotion;
ofxCvColorImage emoteImage;
ofImage tempImage;
std::vector<ofImage> croppedFaces;
int emotionImageMaxBatchSize = 5;
Emotef emo;
Yolo faceDetector;
float* emotional_data;
std::vector<types::BoxfWithLandmarks> detected_faces;
Map map;
ofShader depthToColourShader;
ofFbo rampedFbo;
ofTrueTypeFont tf;
ofFbo video_player_fbo;
ofFbo model_output_fbo;
ofFbo model_output_fbo_1;
ofFbo model_output_fbo_frame;
ofFbo screen_fbo;
ModelThread threadMap;
ModelThread threadVideo;
ModelThread threadYolo;
ModelThread threadEmotion;
std::unique_ptr<Server> server;
Vector7D embedding;
//ofxPiMapper mapper;
};