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.
54 lines
1.5 KiB
54 lines
1.5 KiB
#include "ofApp.h"
|
|
|
|
//--------------------------------------------------------------
|
|
void ofApp::setup(){
|
|
ofSetFrameRate(60);
|
|
//ofDisableArbTex();
|
|
//ofEnableDepthTest();
|
|
ofEnableAlphaBlending();
|
|
|
|
videoPlayer.load(videoPath);
|
|
videoPlayer.setLoopState(OF_LOOP_NORMAL);
|
|
videoPlayer.play();
|
|
|
|
inputImage.allocate(640, 640, OF_IMAGE_COLOR); // Allocate image, so we don't get any issues when processing on the thread
|
|
videoFrame.allocate(1920, 1080, OF_IMAGE_COLOR);
|
|
|
|
onnx.setup(&inputImage); // setup onnx -> will need to pass in a pointer to the two fbos?
|
|
}
|
|
|
|
//--------------------------------------------------------------
|
|
void ofApp::update(){
|
|
videoPlayer.update();
|
|
if(videoPlayer.isFrameNew()) {
|
|
ofPixels & p = videoPlayer.getPixels();
|
|
videoFrame.setFromPixels(p);
|
|
}
|
|
onnx.update(videoFrame);
|
|
|
|
// Get the intensity, emotion of highest intensity, and number of people detected
|
|
teleprompter->updateCVData(onnx.detectedFaces.size(), onnx.dominantEmotion, onnx.highestEmotionIntensity);
|
|
|
|
//ofLog() << ofGetFrameRate();
|
|
}
|
|
|
|
//--------------------------------------------------------------
|
|
void ofApp::draw(){
|
|
//videoPlayer.draw(0, 0, 1920, 1080);
|
|
onnx.draw();
|
|
}
|
|
|
|
//--------------------------------------------------------------
|
|
void ofApp::exit(){
|
|
|
|
}
|
|
|
|
//--------------------------------------------------------------
|
|
void ofApp::keyPressed(int key){
|
|
|
|
}
|
|
|
|
//--------------------------------------------------------------
|
|
void ofApp::keyReleased(int key){
|
|
|
|
}
|