ESP
0.1
The Example-based Sensor Predictions (ESP) system tries to bring machine learning to the maker community.
|
Emulate mouse double-clicks at locations corresponding to prediction results. More...
#include <ostream.h>
Public Member Functions | |
MacOSMouseOStream (std::map< uint32_t, pair< uint32_t, uint32_t > > mouse_mapping) | |
Create a MacOSMouseOStream instance, specifying the locations at which to double-click the mouse for each predicted class label. More... | |
MacOSMouseOStream (uint32_t count,...) | |
Create a MacOSMouseOStream instance, specifying the location at which to double-click the mouse for each predicted class label. More... | |
virtual void | onReceive (uint32_t label) |
Public Member Functions inherited from Stream | |
Stream () | |
virtual bool | start () |
virtual void | stop () |
void | toggle () |
bool | hasStarted () |
Additional Inherited Members | |
Protected Attributes inherited from Stream | |
std::atomic_bool | has_started_ |
Emulate mouse double-clicks at locations corresponding to prediction results.
This class generates a mouse double-click at locations corresponding to class labels predicted by the current pipeline. The mapping from class labels to locations is specified in the constructor. Note that no double-click will be generated if less than 500 ms have elapsed since the last double-click.
To use an MacOSMouseOStream instance in your application, pass it to useOutputStream() in your setup() function.
|
inline |
Create a MacOSMouseOStream instance, specifying the locations at which to double-click the mouse for each predicted class label.
mouse_mapping | a map from predicted class labels to screen locations (x, y pairs). Note that class 0 is the GRT's special null prediction label and is not used to generate mouse clicks. |
|
inline |
Create a MacOSMouseOStream instance, specifying the location at which to double-click the mouse for each predicted class label.
count | the number of locations specified |
... | the location at which to "double-click" upon prediction of the corresponding class label. Each location is specified by two uint32_t parameters: x then y. The first location (first two parameters) specified corresponds to class label 1, the second (parameters 3 and 4) to class label 2, etc. |
|
inlinevirtual |
Implements OStream.