Repository navigation
Expand file tree
/
Copy pathVisualInferenceCallback.h
More file actions
49 lines (37 loc) · 1.6 KB
/
Copy pathVisualInferenceCallback.h
File metadata and controls
49 lines (37 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* Visual Inference Callback
*
* From: https://github.com/PokemonAutomation/
*
*/
#ifndef PokemonAutomation_CommonTools_VisualInferenceCallback_H
#define PokemonAutomation_CommonTools_VisualInferenceCallback_H
#include <string>
#include "Common/Cpp/Time.h"
#include "InferenceCallback.h"
namespace PokemonAutomation{
class ImageViewRGB32;
class ImageRGB32;
struct VideoSnapshot;
class VideoOverlaySet;
// Base class for a visual inference object to be called perioridically by
// inference routines in InferenceRoutines.h.
class VisualInferenceCallback : public InferenceCallback{
public:
VisualInferenceCallback(std::string label)
: InferenceCallback(InferenceType::VISUAL, std::move(label))
{}
// The inference routines call this function to create video overlays to visualize
// regions of interest of the inference callback.
virtual void make_overlays(VideoOverlaySet& items) const = 0;
// Return true if the inference session should stop.
// You must override at least one of the overloaded `process_frame()`.
// The base class's implementation is just calling the other overloaded
// `process_frame(const ImageViewRGB32& frame, WallClock timestamp)`.
virtual bool process_frame(const VideoSnapshot& frame);
// Return true if the inference session should stop.
// You must override at least one of the overloaded `process_frame()`.
// The base class's implementation throws `InternalProgramError`.
virtual bool process_frame(const ImageViewRGB32& frame, WallClock timestamp);
};
}
#endif