add c++ binding chicken scratches
This commit is contained in:
parent
8502ed9806
commit
a53cc09605
27
mediapipe/dart/mediapipe/cc/packet.c
Normal file
27
mediapipe/dart/mediapipe/cc/packet.c
Normal file
|
@ -0,0 +1,27 @@
|
|||
#include "packet.h"
|
||||
|
||||
char *packet_create_string(char *data)
|
||||
{
|
||||
|
||||
// another possibility -
|
||||
// call MediaPipe functionality here instead of
|
||||
// having another C++ layer?
|
||||
|
||||
return PacketBinding.create_string(data);
|
||||
}
|
||||
|
||||
// psueodcode option 1 for high level C-wrapper:
|
||||
// ClassificationResult classify_text(char* data) {
|
||||
// packets = create_input_packets(data)
|
||||
// results = classify(packets)
|
||||
// return results
|
||||
// }
|
||||
|
||||
// psueodcode option 2 for high level C-wrapper:
|
||||
// char* classify_text(char* data) {
|
||||
// packets = create_input_packets(data)
|
||||
// // could `results` already be a serioalized proto?
|
||||
// results = classify(packets)
|
||||
// // then we return the serialized proto straight to Dart?
|
||||
// return results
|
||||
// }
|
108
mediapipe/dart/mediapipe/cc/packet.cc
Normal file
108
mediapipe/dart/mediapipe/cc/packet.cc
Normal file
|
@ -0,0 +1,108 @@
|
|||
#include "google3/third_party/mediapipe/framework/packet.h";
|
||||
|
||||
// Copied from: https://source.corp.google.com/piper///depot/google3/third_party/mediapipe/python/pybind/packet_creator.cc;rcl=549487063
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
class PacketBinding
|
||||
{
|
||||
Packet create_string(std::string &data)
|
||||
{
|
||||
// actually call MediaPipe
|
||||
}
|
||||
|
||||
Packet create_bool(bool data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_int8(int8 data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_int16(int16 data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_int32(int32 data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_int64(int64 data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_uint8(uint8 data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_uint16(uint16 data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_uint32(uint32 data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_uint64(uint64 data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_float(float data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_double(double data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_int_array(std::vector<int> &data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_float_array(std::vector<float> &data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_int_vector(std::vector<int> &data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_bool_vector(std::vector<bool> &data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_float_vector(std::vector<float> &data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_string_vector(std::vector<std::string> &data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_image_vector(std::vector<Image> &data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_packet_vector(std::vector<Packet> &data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_string_to_packet_map(std::map<std::string, Packet> &data)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_matrix(Eigen::MatrixXf &matrix, bool transpose)
|
||||
{
|
||||
}
|
||||
|
||||
Packet create_from_serialized(const bytes &encoding)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
40
mediapipe/dart/mediapipe/cc/task_runner.cc
Normal file
40
mediapipe/dart/mediapipe/cc/task_runner.cc
Normal file
|
@ -0,0 +1,40 @@
|
|||
#include "third_party/mediapipe/tasks/cc/core/task_runner.h"
|
||||
|
||||
// Inspired by: https://source.corp.google.com/piper///depot/google3/third_party/mediapipe/tasks/python/core/pybind/task_runner.cc;l=42;rcl=549487063
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
TaskRunner task_runner_create(CalculatorGraphConfig graph_config)
|
||||
{
|
||||
}
|
||||
|
||||
Map task_runner_process(TaskRunner runner, Map input_packets)
|
||||
{
|
||||
}
|
||||
|
||||
void task_runner_send(TaskRunner runner, Map input_packets)
|
||||
{
|
||||
}
|
||||
|
||||
void task_runner_send(TaskRunner runner, Map input_packets)
|
||||
{
|
||||
}
|
||||
|
||||
void task_runner_close(TaskRunner runner)
|
||||
{
|
||||
}
|
||||
|
||||
void task_runner_restart(TaskRunner runner)
|
||||
{
|
||||
}
|
||||
|
||||
CalculatorGraphConfig task_runner_get_graph_config(TaskRunner runner)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user