diff --git a/README.md b/README.md
deleted file mode 100644
index 6960314..0000000
--- a/README.md
+++ /dev/null
@@ -1,27 +0,0 @@
-### 工程简介:
-
-#### 工程包括PC端以及android端:其中PC端包括AI运算部分以及Web服务部分,android端包括app以及网页部分。上述除Web服务部分均具有手语翻译功能,且均可实现本地运算与云上运算。
-
-#### android端包括app及网页部分,在设备算力足够的情况下进行本地运算,如果算力不足则可选择云上运算。如果您想为本项目贡献更多,可以分享您的算力为他人提供运算。android端主要模块如下:
-
-```
-media_camera()//获取摄像头的视频流
-media_pipe()//获取云上视频流,为他人提供运算
-hands_recegnation()//对手语进行识别,转化为自然语言
-word_show()//在本地输出转化后的自然语言
-word_send()//向云端发送转化后的自然语言,为他人提供运算
-word_input()//本地输入自然语言转化为手语动画
-word_recv()//接收云端的数据转化为手语
-hands_translation()//将输入的自然语言转化为手语数据
-hands_3d()//根据数据生成3d手语动画
-```
-
-#### PC端包括AI运算部分以及Web服务部分,AI部分为其它设备提供算力支持,Web服务部分则进行提供android端网页链接及设备算力共享服务。PC端主要模块如下:
-
-```
-包含android所有算力共享服务
-nginx-rtmp()//提供视频流传输服务
-load_alancing()//负载均衡,为算力共享设备选择提供服务
-Webserver()//为网页提供后端支持
-```
-
diff --git a/model/手语翻译 (1).png b/model/手语翻译 (1).png
new file mode 100644
index 0000000..c594ece
Binary files /dev/null and b/model/手语翻译 (1).png differ
diff --git a/model/显示动画.png b/model/显示动画.png
new file mode 100644
index 0000000..49ed648
Binary files /dev/null and b/model/显示动画.png differ
diff --git a/model/显示自然语言 (4).png b/model/显示自然语言 (4).png
new file mode 100644
index 0000000..de61abc
Binary files /dev/null and b/model/显示自然语言 (4).png differ
diff --git a/model/用例图.png b/model/用例图.png
new file mode 100644
index 0000000..d19fd7e
Binary files /dev/null and b/model/用例图.png differ
diff --git a/model/翻译自然语言为动画.png b/model/翻译自然语言为动画.png
new file mode 100644
index 0000000..e7cb3d9
Binary files /dev/null and b/model/翻译自然语言为动画.png differ
diff --git a/model/获取手语视频.png b/model/获取手语视频.png
new file mode 100644
index 0000000..4fefd82
Binary files /dev/null and b/model/获取手语视频.png differ
diff --git a/model/输入自然语言.png b/model/输入自然语言.png
new file mode 100644
index 0000000..b918878
Binary files /dev/null and b/model/输入自然语言.png differ
diff --git a/src/p2/README.md b/src/p2/README.md
new file mode 100644
index 0000000..2f30bb3
--- /dev/null
+++ b/src/p2/README.md
@@ -0,0 +1,2 @@
+# work1
+
diff --git a/src/p2/demo2.py b/src/p2/demo2.py
new file mode 100644
index 0000000..53d43bd
--- /dev/null
+++ b/src/p2/demo2.py
@@ -0,0 +1,99 @@
+import os
+import tensorflow as tf
+train_dataset_url = "https://storage.googleapis.com/download.tensorflow.org/data/iris_training.csv"
+file_url = "file:///home/smj/Work/mhand/test.csv"
+train_dataset_fp = tf.keras.utils.get_file(fname=os.path.basename(train_dataset_url),
+ origin=train_dataset_url)
+
+print("Local copy of the dataset file: {}".format(train_dataset_fp))
+# column order in CSV file
+
+class_names = ['Iris setosa', 'Iris versicolor', 'Iris virginica']
+
+batch_size = 32
+
+train_dataset = tf.data.experimental.make_csv_dataset(
+ train_dataset_fp,
+ batch_size,
+ label_name="virginica",
+ num_epochs=1)
+features, labels = next(iter(train_dataset))
+
+
+def pack_features_vector(features, labels):
+ """Pack the features into a single array."""
+ features = tf.stack(list(features.values()), axis=1)
+ return features, labels
+
+train_dataset = train_dataset.map(pack_features_vector)
+features, labels = next(iter(train_dataset))
+print(features)
+
+model = tf.keras.Sequential([
+ tf.keras.layers.Dense(10, activation=tf.nn.relu, input_shape=(4,)), # input shape required
+ tf.keras.layers.Dense(10, activation=tf.nn.relu),
+ tf.keras.layers.Dense(3)
+])
+# features[0].shape=(4,0)
+predictions = model(features)
+tf.nn.softmax(predictions[:5])
+loss_object = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True)
+
+def loss(model, x, y, training):
+ # training=training is needed only if there are layers with different
+ # behavior during training versus inference (e.g. Dropout).
+ y_ = model(x, training=training)
+
+ return loss_object(y_true=y, y_pred=y_)
+
+
+l = loss(model, features, labels, training=False)
+def grad(model, inputs, targets):
+ with tf.GradientTape() as tape:
+ loss_value = loss(model, inputs, targets, training=True)
+ return loss_value, tape.gradient(loss_value, model.trainable_variables)
+
+optimizer = tf.keras.optimizers.SGD(learning_rate=0.01)
+loss_value, grads = grad(model, features, labels)
+
+print("Step: {}, Initial Loss: {}".format(optimizer.iterations.numpy(),
+ loss_value.numpy()))
+
+optimizer.apply_gradients(zip(grads, model.trainable_variables))
+
+print("Step: {}, Loss: {}".format(optimizer.iterations.numpy(),
+ loss(model, features, labels, training=True).numpy()))
+
+## Note: Rerunning this cell uses the same model variables
+
+# Keep results for plotting
+train_loss_results = []
+train_accuracy_results = []
+
+num_epochs = 201
+
+for epoch in range(num_epochs):
+ epoch_loss_avg = tf.keras.metrics.Mean()
+ epoch_accuracy = tf.keras.metrics.SparseCategoricalAccuracy()
+
+ # Training loop - using batches of 32
+ for x, y in train_dataset:
+ # Optimize the model
+ loss_value, grads = grad(model, x, y)
+ optimizer.apply_gradients(zip(grads, model.trainable_variables))
+
+ # Track progress
+ epoch_loss_avg.update_state(loss_value) # Add current batch loss
+ # Compare predicted label to actual label
+ # training=True is needed only if there are layers with different
+ # behavior during training versus inference (e.g. Dropout).
+ epoch_accuracy.update_state(y, model(x, training=True))
+
+ # End epoch
+ train_loss_results.append(epoch_loss_avg.result())
+ train_accuracy_results.append(epoch_accuracy.result())
+
+ if epoch % 50 == 0:
+ print("Epoch {:03d}: Loss: {:.3f}, Accuracy: {:.3%}".format(epoch,
+ epoch_loss_avg.result(),
+ epoch_accuracy.result()))
\ No newline at end of file
diff --git a/src/p2/hans.js b/src/p2/hans.js
new file mode 100644
index 0000000..35d38ae
--- /dev/null
+++ b/src/p2/hans.js
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/p2/info.db b/src/p2/info.db
new file mode 100644
index 0000000..412bb7f
Binary files /dev/null and b/src/p2/info.db differ
diff --git a/src/p2/model_unquant.tflite b/src/p2/model_unquant.tflite
new file mode 100644
index 0000000..b0be2fe
Binary files /dev/null and b/src/p2/model_unquant.tflite differ
diff --git a/src/p2/sqltools/insert_trans.py b/src/p2/sqltools/insert_trans.py
new file mode 100644
index 0000000..a6706e4
--- /dev/null
+++ b/src/p2/sqltools/insert_trans.py
@@ -0,0 +1,139 @@
+import math
+import sqlite3
+
+print ("数据库打开成功")
+strs = "INSERT INTO XYZ VALUES ("
+
+
+import cv2
+import mediapipe as mp
+
+mp_drawing = mp.solutions.drawing_utils
+mp_drawing_styles = mp.solutions.drawing_styles
+mp_hands = mp.solutions.hands
+
+num = 0
+# For webcam input:
+cap = cv2.VideoCapture(0)
+Left = [0, 0, 0, 0, 0, 0, 0, 0, 0]
+Right = [0, 0, 0, 0, 0, 0, 0, 0, 0]
+
+with mp_hands.Hands(
+ model_complexity=0,
+ max_num_hands=2,
+ min_detection_confidence=0.5,
+ min_tracking_confidence=0.5) as hands:
+ while cap.isOpened():
+ success, image = cap.read()
+ if not success:
+ print("Ignoring empty camera frame.")
+ # If loading a video, use 'break' instead of 'continue'.
+ continue
+
+ # To improve performance, optionally mark the image as not writeable to
+ # pass by reference.
+ image.flags.writeable = False
+ image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
+ results = hands.process(image)
+
+ # Draw the hand annotations on the image.
+ image.flags.writeable = True
+ image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
+ aa=0
+ if results.multi_hand_landmarks:
+ for i,hand_landmarks in enumerate(results.multi_hand_landmarks):
+ Left = [0, 0, 0, 0, 0, 0, 0, 0, 0]
+ Right = [0, 0, 0, 0, 0, 0, 0, 0, 0]
+ if (results.multi_handedness[i].classification[0].label)=="Left":
+ Left[0] = 1
+ wrist = hand_landmarks.landmark[0]
+ index_finger_mcp = hand_landmarks.landmark[5]
+ index_finger_tip = hand_landmarks.landmark[8]
+ middle_finger_mcp = hand_landmarks.landmark[9]
+ middle_finger_tip = hand_landmarks.landmark[12]
+ ring_finger_mcp = hand_landmarks.landmark[13]
+ ring_finger_tip = hand_landmarks.landmark[16]
+ pinky_mcp = hand_landmarks.landmark[17]
+ pinky_tip = hand_landmarks.landmark[20]
+
+ one_x = index_finger_mcp.x - pinky_mcp.x
+ one_y = index_finger_mcp.y - pinky_mcp.y
+
+ if (math.fabs(one_x) > math.fabs(one_y)):
+ Left[3]=1
+ if (one_x > 0):
+ Left[1]=1
+ tow = index_finger_mcp.y-wrist.y
+ if (tow < 0): Left[2]=1
+ length = math.fabs(middle_finger_mcp.y-wrist.y) / 3
+ if (math.fabs(index_finger_tip.y-index_finger_mcp.y) > length): Left[5]=1
+ if (math.fabs(middle_finger_tip.y-middle_finger_mcp.y) > length): Left[6]=1
+ if (math.fabs(ring_finger_tip.y-ring_finger_mcp.y) > length): Left[7]=1
+ if (math.fabs(pinky_tip.y-pinky_mcp.y) > length): Left[8]=1
+ else:
+ length = math.fabs(one_y) / 3
+ if (math.fabs(index_finger_mcp.x-index_finger_tip.x) > length): Left[5]=1
+ if (math.fabs(middle_finger_mcp.x-middle_finger_tip.x) > length): Left[6]=1
+ if (math.fabs(ring_finger_mcp.x-ring_finger_tip.x) > length): Left[7]=1
+ if (math.fabs(pinky_mcp.x-pinky_tip.x) > length): Left[8]=1
+ else:
+ Right[0] = 1
+ wrist = hand_landmarks.landmark[0]
+ index_finger_mcp = hand_landmarks.landmark[5]
+
+ index_finger_tip = hand_landmarks.landmark[8]
+
+ middle_finger_mcp = hand_landmarks.landmark[9]
+
+ middle_finger_tip = hand_landmarks.landmark[12]
+
+ ring_finger_mcp = hand_landmarks.landmark[13]
+
+ ring_finger_tip = hand_landmarks.landmark[16]
+
+ pinky_mcp = hand_landmarks.landmark[17]
+
+ pinky_tip = hand_landmarks.landmark[20]
+
+ one_x = index_finger_mcp.x - pinky_mcp.x
+ one_y = index_finger_mcp.y - pinky_mcp.y
+ if (math.fabs(one_x) > math.fabs(one_y)): Right[3]=1
+ if (one_x > 0): Right[1]=1
+ tow = index_finger_mcp.y-wrist.y
+ if (tow < 0): Right[2]=1
+ length = math.fabs(middle_finger_mcp.y-wrist.y) / 3
+ if (math.fabs(index_finger_tip.y-index_finger_mcp.y) > length): Right[5]=1
+ if (math.fabs(middle_finger_tip.y-middle_finger_mcp.y) > length): Right[6]=1
+ if (math.fabs(ring_finger_tip.y-ring_finger_mcp.y) > length): Right[7]=1
+ if (math.fabs(pinky_tip.y-pinky_mcp.y) > length): Right[8]=1
+ else:
+ length = math.fabs(one_y) / 2
+ if (math.fabs(index_finger_mcp.x-index_finger_tip.x) > length): Right[5]=1
+ if (math.fabs(middle_finger_mcp.x-middle_finger_tip.x) > length): Right[6]=1
+ if (math.fabs(ring_finger_mcp.x-ring_finger_tip.x) > length): Right[7]=1
+ if (math.fabs(pinky_mcp.x-pinky_tip.x) > length): Right[8]=1
+ mp_drawing.draw_landmarks(
+ image,
+ hand_landmarks,
+ mp_hands.HAND_CONNECTIONS,
+ mp_drawing_styles.get_default_hand_landmarks_style(),
+ mp_drawing_styles.get_default_hand_connections_style())
+ # Flip the image horizontally for a selfie-view display.
+ cv2.imshow('MediaPipe Hands', cv2.flip(image, 1))
+ ctl = cv2.waitKey(5)
+ if ctl == ord('q'):
+ break
+ elif ctl==ord('s'):
+ print(Left,Right)
+ # strs = "INSERT INTO XYZ VALUES ("
+ # word = "\'"+input()+"\',"
+ # strs+=word
+ # print(aa)
+ # print(len(wt))
+ # for i in wt:
+ # strs+=str(i)[:7]+","
+ # strs = strs[:-1] + ")"
+cap.release()
+
+
+print ("数据插入成功")
diff --git a/src/p2/sqltools/insert_xyz.py b/src/p2/sqltools/insert_xyz.py
new file mode 100644
index 0000000..cbb147a
--- /dev/null
+++ b/src/p2/sqltools/insert_xyz.py
@@ -0,0 +1,78 @@
+import sqlite3
+
+conn = sqlite3.connect('info.db')
+c = conn.cursor()
+print ("数据库打开成功")
+strs = "INSERT INTO XYZ VALUES ("
+
+
+import cv2
+import mediapipe as mp
+
+mp_drawing = mp.solutions.drawing_utils
+mp_drawing_styles = mp.solutions.drawing_styles
+mp_hands = mp.solutions.hands
+
+num = 0
+# For webcam input:
+cap = cv2.VideoCapture(0)
+
+with mp_hands.Hands(
+ model_complexity=0,
+ max_num_hands=2,
+ min_detection_confidence=0.5,
+ min_tracking_confidence=0.5) as hands:
+ while cap.isOpened():
+ success, image = cap.read()
+ if not success:
+ print("Ignoring empty camera frame.")
+ # If loading a video, use 'break' instead of 'continue'.
+ continue
+
+ # To improve performance, optionally mark the image as not writeable to
+ # pass by reference.
+ image.flags.writeable = False
+ image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
+ results = hands.process(image)
+
+ # Draw the hand annotations on the image.
+ image.flags.writeable = True
+ image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
+ aa=0
+ if results.multi_hand_landmarks:
+ wt = []
+ for i in range(42 * 3):
+ wt.append(0)
+ for i,hand_landmarks in enumerate(results.multi_hand_landmarks):
+ if (results.multi_handedness[i].classification[0].label)=="Left":
+ num = 0
+ else:
+ num =1
+ for j,handlms in enumerate(hand_landmarks.landmark):
+ wt[num*21*3+j*3],wt[num*21*3+j*3+1],wt[num*21*3+j*3+2] = handlms.x, handlms.y, handlms.z
+ mp_drawing.draw_landmarks(
+ image,
+ hand_landmarks,
+ mp_hands.HAND_CONNECTIONS,
+ mp_drawing_styles.get_default_hand_landmarks_style(),
+ mp_drawing_styles.get_default_hand_connections_style())
+ # Flip the image horizontally for a selfie-view display.
+ cv2.imshow('MediaPipe Hands', cv2.flip(image, 1))
+ ctl = cv2.waitKey(5)
+ if ctl == ord('q'):
+ break
+ elif ctl==ord('s'):
+ strs = "INSERT INTO XYZ VALUES ("
+ word = "\'"+input()+"\',"
+ strs+=word
+ print(aa)
+ for i in wt:
+ strs+=str(i)[:7]+","
+ strs = strs[:-1] + ");"
+ print(strs)
+ c.execute(strs)
+cap.release()
+conn.commit()
+
+print ("数据插入成功")
+conn.close()
\ No newline at end of file
diff --git a/src/p2/sqltools/sqliteinsert.py b/src/p2/sqltools/sqliteinsert.py
new file mode 100644
index 0000000..3881442
--- /dev/null
+++ b/src/p2/sqltools/sqliteinsert.py
@@ -0,0 +1,20 @@
+import sqlite3
+
+conn = sqlite3.connect('info.db')
+c = conn.cursor()
+print ("数据库打开成功")
+def insert_xyz():
+ strs = "INSERT INTO XYZ VALUES ('这',"
+ for i in range(21*4):
+ strs+=str(i+0.01)+","
+ strs=strs[:-1]+");"
+ c.execute(strs)
+
+def insert_trans():
+ strs = "INSERT INTO TRANSLATION VALUES('好','100000000|000000000');"
+ print(strs)
+ c.execute(strs)
+
+conn.commit()
+print ("数据插入成功")
+conn.close()
\ No newline at end of file
diff --git a/src/p2/sqltools/sqlites.py b/src/p2/sqltools/sqlites.py
new file mode 100644
index 0000000..eed7496
--- /dev/null
+++ b/src/p2/sqltools/sqlites.py
@@ -0,0 +1,15 @@
+import sqlite3
+
+conn = sqlite3.connect('info.db')
+print ("数据库打开成功")
+c = conn.cursor()
+strs = "CREATE TABLE TRANSLATION(WORD TEXT PRIMARY KEY NOT NULL,NUM TEXT);"
+# strnum = "CREATE TABLE XYZ(WORD TEXT PRIMARY KEY NOT NULL,"
+# for i in range(21*2*2):
+# strnum+="fig"+str(i).zfill(2)+" FLOAT NOT NULL,"
+# strnum=strnum[:-1]+");"
+print(strs)
+c.execute(strs)
+print ("数据表创建成功")
+conn.commit()
+conn.close()
\ No newline at end of file
diff --git a/src/p2/test.py b/src/p2/test.py
new file mode 100644
index 0000000..1f6ff10
--- /dev/null
+++ b/src/p2/test.py
@@ -0,0 +1,32 @@
+import tensorflow as tf
+import csv
+new_model = tf.keras.models.load_model('model')
+
+# Check its architecture
+new_model.summary()
+
+train_label = []
+train_feature=[]
+with open("test.csv","r") as r:
+ reader = csv.reader(r)
+ for i in reader:
+ train_label.append((eval(i.pop())))
+ b = [eval(j) for j in i]
+ train_feature.append(b)
+train_features = tf.constant(train_feature)
+train_labels = tf.constant(train_label)
+
+test_accuracy = tf.keras.metrics.Accuracy()
+
+branch = 32
+for num in range(len(train_features)//branch):
+ # training=False is needed only if there are layers with different
+ # behavior during training versus inference (e.g. Dropout).
+ x = train_features[num*32:(num+1)*32]
+ y = train_labels[num*32:(num+1)*32]
+ logits = new_model(x, training=False)
+ prediction = tf.argmax(logits, axis=1, output_type=tf.int32)
+ print("真实值为",y,"预测值为",prediction)
+ test_accuracy(prediction, y)
+
+print("Test set accuracy: {:.3%}".format(test_accuracy.result()))
\ No newline at end of file
diff --git a/src/p2/test_video.py b/src/p2/test_video.py
new file mode 100644
index 0000000..8afa24d
--- /dev/null
+++ b/src/p2/test_video.py
@@ -0,0 +1,76 @@
+import cv2
+import mediapipe as mp
+import csv
+import tensorflow as tf
+import csv
+new_model = tf.keras.models.load_model('model')
+
+# Check its architecture
+new_model.summary()
+
+def test(inputs):
+ # training=False is needed only if there are layers with different
+ # behavior during training versus inference (e.g. Dropout).
+ x = tf.constant([inputs])
+ logits = new_model(x, training=False)
+ prediction = tf.argmax(logits, axis=1, output_type=tf.int32)
+ print(prediction)
+mp_drawing = mp.solutions.drawing_utils
+mp_drawing_styles = mp.solutions.drawing_styles
+mp_hands = mp.solutions.hands
+
+ls = []
+for i in range(42*3*2):
+ ls.append(0)
+wt = ls
+num = 0
+# For webcam input:
+cap = cv2.VideoCapture(0)
+
+
+with open("test.csv","a") as csvfile:
+ writer = csv.writer(csvfile)
+
+ with mp_hands.Hands(
+ model_complexity=0,
+ max_num_hands=2,
+ min_detection_confidence=0.5,
+ min_tracking_confidence=0.5) as hands:
+ while cap.isOpened():
+ success, image = cap.read()
+ if not success:
+ print("Ignoring empty camera frame.")
+ # If loading a video, use 'break' instead of 'continue'.
+ continue
+
+ # To improve performance, optionally mark the image as not writeable to
+ # pass by reference.
+ image.flags.writeable = False
+ image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
+ results = hands.process(image)
+
+ # Draw the hand annotations on the image.
+ image.flags.writeable = True
+ image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
+
+ if results.multi_hand_landmarks:
+ for i,hand_landmarks in enumerate(results.multi_hand_landmarks):
+ if (results.multi_handedness[i].classification[0].label)=="Left":
+ num = 0
+ else:
+ num =1
+ for j,handlms in enumerate(hand_landmarks.landmark):
+ wt[num*21*3+j],wt[num*21*3+j+1],wt[num*21*3+j+2] = handlms.x, handlms.y, handlms.z
+ mp_drawing.draw_landmarks(
+ image,
+ hand_landmarks,
+ mp_hands.HAND_CONNECTIONS,
+ mp_drawing_styles.get_default_hand_landmarks_style(),
+ mp_drawing_styles.get_default_hand_connections_style())
+ # Flip the image horizontally for a selfie-view display.
+ test(wt)
+ cv2.imshow('MediaPipe Hands', cv2.flip(image, 1))
+ ctl = cv2.waitKey(5)
+ if ctl == ord('q'):
+ break
+cap.release()
\ No newline at end of file
diff --git a/src/p2/tools/calculator_profile_pb2.py b/src/p2/tools/calculator_profile_pb2.py
new file mode 100644
index 0000000..30f5ade
--- /dev/null
+++ b/src/p2/tools/calculator_profile_pb2.py
@@ -0,0 +1,607 @@
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: mediapipe/framework/calculator_profile.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from mediapipe.framework import calculator_pb2 as mediapipe_dot_framework_dot_calculator__pb2
+try:
+ mediapipe_dot_framework_dot_calculator__options__pb2 = mediapipe_dot_framework_dot_calculator__pb2.mediapipe_dot_framework_dot_calculator__options__pb2
+except AttributeError:
+ mediapipe_dot_framework_dot_calculator__options__pb2 = mediapipe_dot_framework_dot_calculator__pb2.mediapipe.framework.calculator_options_pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+ name='mediapipe/framework/calculator_profile.proto',
+ package='mediapipe',
+ syntax='proto2',
+ serialized_options=_b('\n\032com.google.mediapipe.protoB\026CalculatorProfileProto'),
+ serialized_pb=_b('\n,mediapipe/framework/calculator_profile.proto\x12\tmediapipe\x1a$mediapipe/framework/calculator.proto\"o\n\rTimeHistogram\x12\x10\n\x05total\x18\x01 \x01(\x03:\x01\x30\x12#\n\x12interval_size_usec\x18\x02 \x01(\x03:\x07\x31\x30\x30\x30\x30\x30\x30\x12\x18\n\rnum_intervals\x18\x03 \x01(\x03:\x01\x31\x12\r\n\x05\x63ount\x18\x04 \x03(\x03\"b\n\rStreamProfile\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\tback_edge\x18\x02 \x01(\x08:\x05\x66\x61lse\x12)\n\x07latency\x18\x03 \x01(\x0b\x32\x18.mediapipe.TimeHistogram\"\xb3\x02\n\x11\x43\x61lculatorProfile\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x17\n\x0copen_runtime\x18\x02 \x01(\x03:\x01\x30\x12\x18\n\rclose_runtime\x18\x03 \x01(\x03:\x01\x30\x12\x31\n\x0fprocess_runtime\x18\x04 \x01(\x0b\x32\x18.mediapipe.TimeHistogram\x12\x37\n\x15process_input_latency\x18\x05 \x01(\x0b\x32\x18.mediapipe.TimeHistogram\x12\x38\n\x16process_output_latency\x18\x06 \x01(\x0b\x32\x18.mediapipe.TimeHistogram\x12\x37\n\x15input_stream_profiles\x18\x07 \x03(\x0b\x32\x18.mediapipe.StreamProfile\"\xe9\x06\n\nGraphTrace\x12\x11\n\tbase_time\x18\x01 \x01(\x03\x12\x16\n\x0e\x62\x61se_timestamp\x18\x02 \x01(\x03\x12\x17\n\x0f\x63\x61lculator_name\x18\x03 \x03(\t\x12\x13\n\x0bstream_name\x18\x04 \x03(\t\x12?\n\x10\x63\x61lculator_trace\x18\x05 \x03(\x0b\x32%.mediapipe.GraphTrace.CalculatorTrace\x1a\x8e\x01\n\x0bStreamTrace\x12\x12\n\nstart_time\x18\x01 \x01(\x03\x12\x13\n\x0b\x66inish_time\x18\x02 \x01(\x03\x12\x18\n\x10packet_timestamp\x18\x03 \x01(\x03\x12\x11\n\tstream_id\x18\x04 \x01(\x05\x12\x15\n\tpacket_id\x18\x05 \x01(\x03\x42\x02\x18\x01\x12\x12\n\nevent_data\x18\x06 \x01(\x03\x1a\x9d\x02\n\x0f\x43\x61lculatorTrace\x12\x0f\n\x07node_id\x18\x01 \x01(\x05\x12\x17\n\x0finput_timestamp\x18\x02 \x01(\x03\x12\x33\n\nevent_type\x18\x03 \x01(\x0e\x32\x1f.mediapipe.GraphTrace.EventType\x12\x12\n\nstart_time\x18\x04 \x01(\x03\x12\x13\n\x0b\x66inish_time\x18\x05 \x01(\x03\x12\x36\n\x0binput_trace\x18\x06 \x03(\x0b\x32!.mediapipe.GraphTrace.StreamTrace\x12\x37\n\x0coutput_trace\x18\x07 \x03(\x0b\x32!.mediapipe.GraphTrace.StreamTrace\x12\x11\n\tthread_id\x18\x08 \x01(\x05\"\x8f\x02\n\tEventType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04OPEN\x10\x01\x12\x0b\n\x07PROCESS\x10\x02\x12\t\n\x05\x43LOSE\x10\x03\x12\r\n\tNOT_READY\x10\x04\x12\x15\n\x11READY_FOR_PROCESS\x10\x05\x12\x13\n\x0fREADY_FOR_CLOSE\x10\x06\x12\r\n\tTHROTTLED\x10\x07\x12\x0f\n\x0bUNTHROTTLED\x10\x08\x12\x11\n\rCPU_TASK_USER\x10\t\x12\x13\n\x0f\x43PU_TASK_SYSTEM\x10\n\x12\x0c\n\x08GPU_TASK\x10\x0b\x12\x0c\n\x08\x44SP_TASK\x10\x0c\x12\x0c\n\x08TPU_TASK\x10\r\x12\x13\n\x0fGPU_CALIBRATION\x10\x0e\x12\x11\n\rPACKET_QUEUED\x10\x0f\"\xa7\x01\n\x0cGraphProfile\x12*\n\x0bgraph_trace\x18\x01 \x03(\x0b\x32\x15.mediapipe.GraphTrace\x12\x39\n\x13\x63\x61lculator_profiles\x18\x02 \x03(\x0b\x32\x1c.mediapipe.CalculatorProfile\x12\x30\n\x06\x63onfig\x18\x03 \x01(\x0b\x32 .mediapipe.CalculatorGraphConfigB4\n\x1a\x63om.google.mediapipe.protoB\x16\x43\x61lculatorProfileProto')
+ ,
+ dependencies=[mediapipe_dot_framework_dot_calculator__pb2.DESCRIPTOR,])
+
+
+
+_GRAPHTRACE_EVENTTYPE = _descriptor.EnumDescriptor(
+ name='EventType',
+ full_name='mediapipe.GraphTrace.EventType',
+ filename=None,
+ file=DESCRIPTOR,
+ values=[
+ _descriptor.EnumValueDescriptor(
+ name='UNKNOWN', index=0, number=0,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='OPEN', index=1, number=1,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='PROCESS', index=2, number=2,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='CLOSE', index=3, number=3,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='NOT_READY', index=4, number=4,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='READY_FOR_PROCESS', index=5, number=5,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='READY_FOR_CLOSE', index=6, number=6,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='THROTTLED', index=7, number=7,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='UNTHROTTLED', index=8, number=8,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='CPU_TASK_USER', index=9, number=9,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='CPU_TASK_SYSTEM', index=10, number=10,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='GPU_TASK', index=11, number=11,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='DSP_TASK', index=12, number=12,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='TPU_TASK', index=13, number=13,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='GPU_CALIBRATION', index=14, number=14,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='PACKET_QUEUED', index=15, number=15,
+ serialized_options=None,
+ type=None),
+ ],
+ containing_type=None,
+ serialized_options=None,
+ serialized_start=1223,
+ serialized_end=1494,
+)
+_sym_db.RegisterEnumDescriptor(_GRAPHTRACE_EVENTTYPE)
+
+
+_TIMEHISTOGRAM = _descriptor.Descriptor(
+ name='TimeHistogram',
+ full_name='mediapipe.TimeHistogram',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='total', full_name='mediapipe.TimeHistogram.total', index=0,
+ number=1, type=3, cpp_type=2, label=1,
+ has_default_value=True, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='interval_size_usec', full_name='mediapipe.TimeHistogram.interval_size_usec', index=1,
+ number=2, type=3, cpp_type=2, label=1,
+ has_default_value=True, default_value=1000000,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='num_intervals', full_name='mediapipe.TimeHistogram.num_intervals', index=2,
+ number=3, type=3, cpp_type=2, label=1,
+ has_default_value=True, default_value=1,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='count', full_name='mediapipe.TimeHistogram.count', index=3,
+ number=4, type=3, cpp_type=2, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto2',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=97,
+ serialized_end=208,
+)
+
+
+_STREAMPROFILE = _descriptor.Descriptor(
+ name='StreamProfile',
+ full_name='mediapipe.StreamProfile',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='name', full_name='mediapipe.StreamProfile.name', index=0,
+ number=1, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='back_edge', full_name='mediapipe.StreamProfile.back_edge', index=1,
+ number=2, type=8, cpp_type=7, label=1,
+ has_default_value=True, default_value=False,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='latency', full_name='mediapipe.StreamProfile.latency', index=2,
+ number=3, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto2',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=210,
+ serialized_end=308,
+)
+
+
+_CALCULATORPROFILE = _descriptor.Descriptor(
+ name='CalculatorProfile',
+ full_name='mediapipe.CalculatorProfile',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='name', full_name='mediapipe.CalculatorProfile.name', index=0,
+ number=1, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='open_runtime', full_name='mediapipe.CalculatorProfile.open_runtime', index=1,
+ number=2, type=3, cpp_type=2, label=1,
+ has_default_value=True, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='close_runtime', full_name='mediapipe.CalculatorProfile.close_runtime', index=2,
+ number=3, type=3, cpp_type=2, label=1,
+ has_default_value=True, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='process_runtime', full_name='mediapipe.CalculatorProfile.process_runtime', index=3,
+ number=4, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='process_input_latency', full_name='mediapipe.CalculatorProfile.process_input_latency', index=4,
+ number=5, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='process_output_latency', full_name='mediapipe.CalculatorProfile.process_output_latency', index=5,
+ number=6, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='input_stream_profiles', full_name='mediapipe.CalculatorProfile.input_stream_profiles', index=6,
+ number=7, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto2',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=311,
+ serialized_end=618,
+)
+
+
+_GRAPHTRACE_STREAMTRACE = _descriptor.Descriptor(
+ name='StreamTrace',
+ full_name='mediapipe.GraphTrace.StreamTrace',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='start_time', full_name='mediapipe.GraphTrace.StreamTrace.start_time', index=0,
+ number=1, type=3, cpp_type=2, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='finish_time', full_name='mediapipe.GraphTrace.StreamTrace.finish_time', index=1,
+ number=2, type=3, cpp_type=2, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='packet_timestamp', full_name='mediapipe.GraphTrace.StreamTrace.packet_timestamp', index=2,
+ number=3, type=3, cpp_type=2, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='stream_id', full_name='mediapipe.GraphTrace.StreamTrace.stream_id', index=3,
+ number=4, type=5, cpp_type=1, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='packet_id', full_name='mediapipe.GraphTrace.StreamTrace.packet_id', index=4,
+ number=5, type=3, cpp_type=2, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=_b('\030\001'), file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='event_data', full_name='mediapipe.GraphTrace.StreamTrace.event_data', index=5,
+ number=6, type=3, cpp_type=2, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto2',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=790,
+ serialized_end=932,
+)
+
+_GRAPHTRACE_CALCULATORTRACE = _descriptor.Descriptor(
+ name='CalculatorTrace',
+ full_name='mediapipe.GraphTrace.CalculatorTrace',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='node_id', full_name='mediapipe.GraphTrace.CalculatorTrace.node_id', index=0,
+ number=1, type=5, cpp_type=1, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='input_timestamp', full_name='mediapipe.GraphTrace.CalculatorTrace.input_timestamp', index=1,
+ number=2, type=3, cpp_type=2, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='event_type', full_name='mediapipe.GraphTrace.CalculatorTrace.event_type', index=2,
+ number=3, type=14, cpp_type=8, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='start_time', full_name='mediapipe.GraphTrace.CalculatorTrace.start_time', index=3,
+ number=4, type=3, cpp_type=2, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='finish_time', full_name='mediapipe.GraphTrace.CalculatorTrace.finish_time', index=4,
+ number=5, type=3, cpp_type=2, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='input_trace', full_name='mediapipe.GraphTrace.CalculatorTrace.input_trace', index=5,
+ number=6, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='output_trace', full_name='mediapipe.GraphTrace.CalculatorTrace.output_trace', index=6,
+ number=7, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='thread_id', full_name='mediapipe.GraphTrace.CalculatorTrace.thread_id', index=7,
+ number=8, type=5, cpp_type=1, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto2',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=935,
+ serialized_end=1220,
+)
+
+_GRAPHTRACE = _descriptor.Descriptor(
+ name='GraphTrace',
+ full_name='mediapipe.GraphTrace',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='base_time', full_name='mediapipe.GraphTrace.base_time', index=0,
+ number=1, type=3, cpp_type=2, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='base_timestamp', full_name='mediapipe.GraphTrace.base_timestamp', index=1,
+ number=2, type=3, cpp_type=2, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='calculator_name', full_name='mediapipe.GraphTrace.calculator_name', index=2,
+ number=3, type=9, cpp_type=9, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='stream_name', full_name='mediapipe.GraphTrace.stream_name', index=3,
+ number=4, type=9, cpp_type=9, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='calculator_trace', full_name='mediapipe.GraphTrace.calculator_trace', index=4,
+ number=5, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[_GRAPHTRACE_STREAMTRACE, _GRAPHTRACE_CALCULATORTRACE, ],
+ enum_types=[
+ _GRAPHTRACE_EVENTTYPE,
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto2',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=621,
+ serialized_end=1494,
+)
+
+
+_GRAPHPROFILE = _descriptor.Descriptor(
+ name='GraphProfile',
+ full_name='mediapipe.GraphProfile',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='graph_trace', full_name='mediapipe.GraphProfile.graph_trace', index=0,
+ number=1, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='calculator_profiles', full_name='mediapipe.GraphProfile.calculator_profiles', index=1,
+ number=2, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='config', full_name='mediapipe.GraphProfile.config', index=2,
+ number=3, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto2',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=1497,
+ serialized_end=1664,
+)
+
+_STREAMPROFILE.fields_by_name['latency'].message_type = _TIMEHISTOGRAM
+_CALCULATORPROFILE.fields_by_name['process_runtime'].message_type = _TIMEHISTOGRAM
+_CALCULATORPROFILE.fields_by_name['process_input_latency'].message_type = _TIMEHISTOGRAM
+_CALCULATORPROFILE.fields_by_name['process_output_latency'].message_type = _TIMEHISTOGRAM
+_CALCULATORPROFILE.fields_by_name['input_stream_profiles'].message_type = _STREAMPROFILE
+_GRAPHTRACE_STREAMTRACE.containing_type = _GRAPHTRACE
+_GRAPHTRACE_CALCULATORTRACE.fields_by_name['event_type'].enum_type = _GRAPHTRACE_EVENTTYPE
+_GRAPHTRACE_CALCULATORTRACE.fields_by_name['input_trace'].message_type = _GRAPHTRACE_STREAMTRACE
+_GRAPHTRACE_CALCULATORTRACE.fields_by_name['output_trace'].message_type = _GRAPHTRACE_STREAMTRACE
+_GRAPHTRACE_CALCULATORTRACE.containing_type = _GRAPHTRACE
+_GRAPHTRACE.fields_by_name['calculator_trace'].message_type = _GRAPHTRACE_CALCULATORTRACE
+_GRAPHTRACE_EVENTTYPE.containing_type = _GRAPHTRACE
+_GRAPHPROFILE.fields_by_name['graph_trace'].message_type = _GRAPHTRACE
+_GRAPHPROFILE.fields_by_name['calculator_profiles'].message_type = _CALCULATORPROFILE
+_GRAPHPROFILE.fields_by_name['config'].message_type = mediapipe_dot_framework_dot_calculator__pb2._CALCULATORGRAPHCONFIG
+DESCRIPTOR.message_types_by_name['TimeHistogram'] = _TIMEHISTOGRAM
+DESCRIPTOR.message_types_by_name['StreamProfile'] = _STREAMPROFILE
+DESCRIPTOR.message_types_by_name['CalculatorProfile'] = _CALCULATORPROFILE
+DESCRIPTOR.message_types_by_name['GraphTrace'] = _GRAPHTRACE
+DESCRIPTOR.message_types_by_name['GraphProfile'] = _GRAPHPROFILE
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+TimeHistogram = _reflection.GeneratedProtocolMessageType('TimeHistogram', (_message.Message,), dict(
+ DESCRIPTOR = _TIMEHISTOGRAM,
+ __module__ = 'mediapipe.framework.calculator_profile_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.TimeHistogram)
+ ))
+_sym_db.RegisterMessage(TimeHistogram)
+
+StreamProfile = _reflection.GeneratedProtocolMessageType('StreamProfile', (_message.Message,), dict(
+ DESCRIPTOR = _STREAMPROFILE,
+ __module__ = 'mediapipe.framework.calculator_profile_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.StreamProfile)
+ ))
+_sym_db.RegisterMessage(StreamProfile)
+
+CalculatorProfile = _reflection.GeneratedProtocolMessageType('CalculatorProfile', (_message.Message,), dict(
+ DESCRIPTOR = _CALCULATORPROFILE,
+ __module__ = 'mediapipe.framework.calculator_profile_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.CalculatorProfile)
+ ))
+_sym_db.RegisterMessage(CalculatorProfile)
+
+GraphTrace = _reflection.GeneratedProtocolMessageType('GraphTrace', (_message.Message,), dict(
+
+ StreamTrace = _reflection.GeneratedProtocolMessageType('StreamTrace', (_message.Message,), dict(
+ DESCRIPTOR = _GRAPHTRACE_STREAMTRACE,
+ __module__ = 'mediapipe.framework.calculator_profile_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.GraphTrace.StreamTrace)
+ ))
+ ,
+
+ CalculatorTrace = _reflection.GeneratedProtocolMessageType('CalculatorTrace', (_message.Message,), dict(
+ DESCRIPTOR = _GRAPHTRACE_CALCULATORTRACE,
+ __module__ = 'mediapipe.framework.calculator_profile_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.GraphTrace.CalculatorTrace)
+ ))
+ ,
+ DESCRIPTOR = _GRAPHTRACE,
+ __module__ = 'mediapipe.framework.calculator_profile_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.GraphTrace)
+ ))
+_sym_db.RegisterMessage(GraphTrace)
+_sym_db.RegisterMessage(GraphTrace.StreamTrace)
+_sym_db.RegisterMessage(GraphTrace.CalculatorTrace)
+
+GraphProfile = _reflection.GeneratedProtocolMessageType('GraphProfile', (_message.Message,), dict(
+ DESCRIPTOR = _GRAPHPROFILE,
+ __module__ = 'mediapipe.framework.calculator_profile_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.GraphProfile)
+ ))
+_sym_db.RegisterMessage(GraphProfile)
+
+
+DESCRIPTOR._options = None
+_GRAPHTRACE_STREAMTRACE.fields_by_name['packet_id']._options = None
+# @@protoc_insertion_point(module_scope)
diff --git a/src/p2/tools/mediapipe_options_pb2.py b/src/p2/tools/mediapipe_options_pb2.py
new file mode 100644
index 0000000..5d44377
--- /dev/null
+++ b/src/p2/tools/mediapipe_options_pb2.py
@@ -0,0 +1,64 @@
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: mediapipe/framework/mediapipe_options.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+ name='mediapipe/framework/mediapipe_options.proto',
+ package='mediapipe',
+ syntax='proto2',
+ serialized_options=_b('\n\032com.google.mediapipe.protoB\025MediaPipeOptionsProto'),
+ serialized_pb=_b('\n+mediapipe/framework/mediapipe_options.proto\x12\tmediapipe\"\x1e\n\x10MediaPipeOptions*\n\x08\xa0\x9c\x01\x10\x80\x80\x80\x80\x02\x42\x33\n\x1a\x63om.google.mediapipe.protoB\x15MediaPipeOptionsProto')
+)
+
+
+
+
+_MEDIAPIPEOPTIONS = _descriptor.Descriptor(
+ name='MediaPipeOptions',
+ full_name='mediapipe.MediaPipeOptions',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=True,
+ syntax='proto2',
+ extension_ranges=[(20000, 536870912), ],
+ oneofs=[
+ ],
+ serialized_start=58,
+ serialized_end=88,
+)
+
+DESCRIPTOR.message_types_by_name['MediaPipeOptions'] = _MEDIAPIPEOPTIONS
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+MediaPipeOptions = _reflection.GeneratedProtocolMessageType('MediaPipeOptions', (_message.Message,), dict(
+ DESCRIPTOR = _MEDIAPIPEOPTIONS,
+ __module__ = 'mediapipe.framework.mediapipe_options_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.MediaPipeOptions)
+ ))
+_sym_db.RegisterMessage(MediaPipeOptions)
+
+
+DESCRIPTOR._options = None
+# @@protoc_insertion_point(module_scope)
diff --git a/src/p2/tools/packet_factory_pb2.py b/src/p2/tools/packet_factory_pb2.py
new file mode 100644
index 0000000..faddc0c
--- /dev/null
+++ b/src/p2/tools/packet_factory_pb2.py
@@ -0,0 +1,165 @@
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: mediapipe/framework/packet_factory.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+ name='mediapipe/framework/packet_factory.proto',
+ package='mediapipe',
+ syntax='proto2',
+ serialized_options=_b('\n\032com.google.mediapipe.protoB\022PacketFactoryProto'),
+ serialized_pb=_b('\n(mediapipe/framework/packet_factory.proto\x12\tmediapipe\"\"\n\x14PacketFactoryOptions*\n\x08\xa0\x9c\x01\x10\x80\x80\x80\x80\x02\"\x95\x01\n\x13PacketFactoryConfig\x12\x16\n\x0epacket_factory\x18\x01 \x01(\t\x12\x1a\n\x12output_side_packet\x18\x02 \x01(\t\x12\x18\n\x0f\x65xternal_output\x18\xea\x07 \x01(\t\x12\x30\n\x07options\x18\x03 \x01(\x0b\x32\x1f.mediapipe.PacketFactoryOptions\"E\n\x13PacketManagerConfig\x12.\n\x06packet\x18\x01 \x03(\x0b\x32\x1e.mediapipe.PacketFactoryConfigB0\n\x1a\x63om.google.mediapipe.protoB\x12PacketFactoryProto')
+)
+
+
+
+
+_PACKETFACTORYOPTIONS = _descriptor.Descriptor(
+ name='PacketFactoryOptions',
+ full_name='mediapipe.PacketFactoryOptions',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=True,
+ syntax='proto2',
+ extension_ranges=[(20000, 536870912), ],
+ oneofs=[
+ ],
+ serialized_start=55,
+ serialized_end=89,
+)
+
+
+_PACKETFACTORYCONFIG = _descriptor.Descriptor(
+ name='PacketFactoryConfig',
+ full_name='mediapipe.PacketFactoryConfig',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='packet_factory', full_name='mediapipe.PacketFactoryConfig.packet_factory', index=0,
+ number=1, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='output_side_packet', full_name='mediapipe.PacketFactoryConfig.output_side_packet', index=1,
+ number=2, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='external_output', full_name='mediapipe.PacketFactoryConfig.external_output', index=2,
+ number=1002, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='options', full_name='mediapipe.PacketFactoryConfig.options', index=3,
+ number=3, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto2',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=92,
+ serialized_end=241,
+)
+
+
+_PACKETMANAGERCONFIG = _descriptor.Descriptor(
+ name='PacketManagerConfig',
+ full_name='mediapipe.PacketManagerConfig',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='packet', full_name='mediapipe.PacketManagerConfig.packet', index=0,
+ number=1, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto2',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=243,
+ serialized_end=312,
+)
+
+_PACKETFACTORYCONFIG.fields_by_name['options'].message_type = _PACKETFACTORYOPTIONS
+_PACKETMANAGERCONFIG.fields_by_name['packet'].message_type = _PACKETFACTORYCONFIG
+DESCRIPTOR.message_types_by_name['PacketFactoryOptions'] = _PACKETFACTORYOPTIONS
+DESCRIPTOR.message_types_by_name['PacketFactoryConfig'] = _PACKETFACTORYCONFIG
+DESCRIPTOR.message_types_by_name['PacketManagerConfig'] = _PACKETMANAGERCONFIG
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+PacketFactoryOptions = _reflection.GeneratedProtocolMessageType('PacketFactoryOptions', (_message.Message,), dict(
+ DESCRIPTOR = _PACKETFACTORYOPTIONS,
+ __module__ = 'mediapipe.framework.packet_factory_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.PacketFactoryOptions)
+ ))
+_sym_db.RegisterMessage(PacketFactoryOptions)
+
+PacketFactoryConfig = _reflection.GeneratedProtocolMessageType('PacketFactoryConfig', (_message.Message,), dict(
+ DESCRIPTOR = _PACKETFACTORYCONFIG,
+ __module__ = 'mediapipe.framework.packet_factory_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.PacketFactoryConfig)
+ ))
+_sym_db.RegisterMessage(PacketFactoryConfig)
+
+PacketManagerConfig = _reflection.GeneratedProtocolMessageType('PacketManagerConfig', (_message.Message,), dict(
+ DESCRIPTOR = _PACKETMANAGERCONFIG,
+ __module__ = 'mediapipe.framework.packet_factory_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.PacketManagerConfig)
+ ))
+_sym_db.RegisterMessage(PacketManagerConfig)
+
+
+DESCRIPTOR._options = None
+# @@protoc_insertion_point(module_scope)
diff --git a/src/p2/tools/packet_generator_pb2.py b/src/p2/tools/packet_generator_pb2.py
new file mode 100644
index 0000000..bd3e11b
--- /dev/null
+++ b/src/p2/tools/packet_generator_pb2.py
@@ -0,0 +1,146 @@
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: mediapipe/framework/packet_generator.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+ name='mediapipe/framework/packet_generator.proto',
+ package='mediapipe',
+ syntax='proto2',
+ serialized_options=_b('\n\032com.google.mediapipe.protoB\024PacketGeneratorProto'),
+ serialized_pb=_b('\n*mediapipe/framework/packet_generator.proto\x12\tmediapipe\"@\n\x16PacketGeneratorOptions\x12\x1a\n\x0cmerge_fields\x18\x01 \x01(\x08:\x04true*\n\x08\xa0\x9c\x01\x10\x80\x80\x80\x80\x02\"\xcf\x01\n\x15PacketGeneratorConfig\x12\x18\n\x10packet_generator\x18\x01 \x01(\t\x12\x19\n\x11input_side_packet\x18\x02 \x03(\t\x12\x17\n\x0e\x65xternal_input\x18\xea\x07 \x03(\t\x12\x1a\n\x12output_side_packet\x18\x03 \x03(\t\x12\x18\n\x0f\x65xternal_output\x18\xeb\x07 \x03(\t\x12\x32\n\x07options\x18\x04 \x01(\x0b\x32!.mediapipe.PacketGeneratorOptionsB2\n\x1a\x63om.google.mediapipe.protoB\x14PacketGeneratorProto')
+)
+
+
+
+
+_PACKETGENERATOROPTIONS = _descriptor.Descriptor(
+ name='PacketGeneratorOptions',
+ full_name='mediapipe.PacketGeneratorOptions',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='merge_fields', full_name='mediapipe.PacketGeneratorOptions.merge_fields', index=0,
+ number=1, type=8, cpp_type=7, label=1,
+ has_default_value=True, default_value=True,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=True,
+ syntax='proto2',
+ extension_ranges=[(20000, 536870912), ],
+ oneofs=[
+ ],
+ serialized_start=57,
+ serialized_end=121,
+)
+
+
+_PACKETGENERATORCONFIG = _descriptor.Descriptor(
+ name='PacketGeneratorConfig',
+ full_name='mediapipe.PacketGeneratorConfig',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='packet_generator', full_name='mediapipe.PacketGeneratorConfig.packet_generator', index=0,
+ number=1, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='input_side_packet', full_name='mediapipe.PacketGeneratorConfig.input_side_packet', index=1,
+ number=2, type=9, cpp_type=9, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='external_input', full_name='mediapipe.PacketGeneratorConfig.external_input', index=2,
+ number=1002, type=9, cpp_type=9, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='output_side_packet', full_name='mediapipe.PacketGeneratorConfig.output_side_packet', index=3,
+ number=3, type=9, cpp_type=9, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='external_output', full_name='mediapipe.PacketGeneratorConfig.external_output', index=4,
+ number=1003, type=9, cpp_type=9, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='options', full_name='mediapipe.PacketGeneratorConfig.options', index=5,
+ number=4, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto2',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=124,
+ serialized_end=331,
+)
+
+_PACKETGENERATORCONFIG.fields_by_name['options'].message_type = _PACKETGENERATOROPTIONS
+DESCRIPTOR.message_types_by_name['PacketGeneratorOptions'] = _PACKETGENERATOROPTIONS
+DESCRIPTOR.message_types_by_name['PacketGeneratorConfig'] = _PACKETGENERATORCONFIG
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+PacketGeneratorOptions = _reflection.GeneratedProtocolMessageType('PacketGeneratorOptions', (_message.Message,), dict(
+ DESCRIPTOR = _PACKETGENERATOROPTIONS,
+ __module__ = 'mediapipe.framework.packet_generator_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.PacketGeneratorOptions)
+ ))
+_sym_db.RegisterMessage(PacketGeneratorOptions)
+
+PacketGeneratorConfig = _reflection.GeneratedProtocolMessageType('PacketGeneratorConfig', (_message.Message,), dict(
+ DESCRIPTOR = _PACKETGENERATORCONFIG,
+ __module__ = 'mediapipe.framework.packet_generator_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.PacketGeneratorConfig)
+ ))
+_sym_db.RegisterMessage(PacketGeneratorConfig)
+
+
+DESCRIPTOR._options = None
+# @@protoc_insertion_point(module_scope)
diff --git a/src/p2/tools/status_handler_pb2.py b/src/p2/tools/status_handler_pb2.py
new file mode 100644
index 0000000..0f28ea7
--- /dev/null
+++ b/src/p2/tools/status_handler_pb2.py
@@ -0,0 +1,95 @@
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: mediapipe/framework/status_handler.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from mediapipe.framework import mediapipe_options_pb2 as mediapipe_dot_framework_dot_mediapipe__options__pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+ name='mediapipe/framework/status_handler.proto',
+ package='mediapipe',
+ syntax='proto2',
+ serialized_options=_b('\n\032com.google.mediapipe.protoB\022StatusHandlerProto'),
+ serialized_pb=_b('\n(mediapipe/framework/status_handler.proto\x12\tmediapipe\x1a+mediapipe/framework/mediapipe_options.proto\"\x8f\x01\n\x13StatusHandlerConfig\x12\x16\n\x0estatus_handler\x18\x01 \x01(\t\x12\x19\n\x11input_side_packet\x18\x02 \x03(\t\x12\x17\n\x0e\x65xternal_input\x18\xea\x07 \x03(\t\x12,\n\x07options\x18\x03 \x01(\x0b\x32\x1b.mediapipe.MediaPipeOptionsB0\n\x1a\x63om.google.mediapipe.protoB\x12StatusHandlerProto')
+ ,
+ dependencies=[mediapipe_dot_framework_dot_mediapipe__options__pb2.DESCRIPTOR,])
+
+
+
+
+_STATUSHANDLERCONFIG = _descriptor.Descriptor(
+ name='StatusHandlerConfig',
+ full_name='mediapipe.StatusHandlerConfig',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='status_handler', full_name='mediapipe.StatusHandlerConfig.status_handler', index=0,
+ number=1, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='input_side_packet', full_name='mediapipe.StatusHandlerConfig.input_side_packet', index=1,
+ number=2, type=9, cpp_type=9, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='external_input', full_name='mediapipe.StatusHandlerConfig.external_input', index=2,
+ number=1002, type=9, cpp_type=9, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='options', full_name='mediapipe.StatusHandlerConfig.options', index=3,
+ number=3, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto2',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=101,
+ serialized_end=244,
+)
+
+_STATUSHANDLERCONFIG.fields_by_name['options'].message_type = mediapipe_dot_framework_dot_mediapipe__options__pb2._MEDIAPIPEOPTIONS
+DESCRIPTOR.message_types_by_name['StatusHandlerConfig'] = _STATUSHANDLERCONFIG
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+StatusHandlerConfig = _reflection.GeneratedProtocolMessageType('StatusHandlerConfig', (_message.Message,), dict(
+ DESCRIPTOR = _STATUSHANDLERCONFIG,
+ __module__ = 'mediapipe.framework.status_handler_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.StatusHandlerConfig)
+ ))
+_sym_db.RegisterMessage(StatusHandlerConfig)
+
+
+DESCRIPTOR._options = None
+# @@protoc_insertion_point(module_scope)
diff --git a/src/p2/tools/stream_handler_pb2.py b/src/p2/tools/stream_handler_pb2.py
new file mode 100644
index 0000000..d6920ae
--- /dev/null
+++ b/src/p2/tools/stream_handler_pb2.py
@@ -0,0 +1,135 @@
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: mediapipe/framework/stream_handler.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from mediapipe.framework import mediapipe_options_pb2 as mediapipe_dot_framework_dot_mediapipe__options__pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+ name='mediapipe/framework/stream_handler.proto',
+ package='mediapipe',
+ syntax='proto2',
+ serialized_options=_b('\n\032com.google.mediapipe.protoB\022StreamHandlerProto'),
+ serialized_pb=_b('\n(mediapipe/framework/stream_handler.proto\x12\tmediapipe\x1a+mediapipe/framework/mediapipe_options.proto\"\x81\x01\n\x18InputStreamHandlerConfig\x12\x37\n\x14input_stream_handler\x18\x01 \x01(\t:\x19\x44\x65\x66\x61ultInputStreamHandler\x12,\n\x07options\x18\x03 \x01(\x0b\x32\x1b.mediapipe.MediaPipeOptions\"\x9f\x01\n\x19OutputStreamHandlerConfig\x12\x39\n\x15output_stream_handler\x18\x01 \x01(\t:\x1aInOrderOutputStreamHandler\x12\x19\n\x11input_side_packet\x18\x02 \x03(\t\x12,\n\x07options\x18\x03 \x01(\x0b\x32\x1b.mediapipe.MediaPipeOptionsB0\n\x1a\x63om.google.mediapipe.protoB\x12StreamHandlerProto')
+ ,
+ dependencies=[mediapipe_dot_framework_dot_mediapipe__options__pb2.DESCRIPTOR,])
+
+
+
+
+_INPUTSTREAMHANDLERCONFIG = _descriptor.Descriptor(
+ name='InputStreamHandlerConfig',
+ full_name='mediapipe.InputStreamHandlerConfig',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='input_stream_handler', full_name='mediapipe.InputStreamHandlerConfig.input_stream_handler', index=0,
+ number=1, type=9, cpp_type=9, label=1,
+ has_default_value=True, default_value=_b("DefaultInputStreamHandler").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='options', full_name='mediapipe.InputStreamHandlerConfig.options', index=1,
+ number=3, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto2',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=101,
+ serialized_end=230,
+)
+
+
+_OUTPUTSTREAMHANDLERCONFIG = _descriptor.Descriptor(
+ name='OutputStreamHandlerConfig',
+ full_name='mediapipe.OutputStreamHandlerConfig',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='output_stream_handler', full_name='mediapipe.OutputStreamHandlerConfig.output_stream_handler', index=0,
+ number=1, type=9, cpp_type=9, label=1,
+ has_default_value=True, default_value=_b("InOrderOutputStreamHandler").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='input_side_packet', full_name='mediapipe.OutputStreamHandlerConfig.input_side_packet', index=1,
+ number=2, type=9, cpp_type=9, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='options', full_name='mediapipe.OutputStreamHandlerConfig.options', index=2,
+ number=3, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto2',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=233,
+ serialized_end=392,
+)
+
+_INPUTSTREAMHANDLERCONFIG.fields_by_name['options'].message_type = mediapipe_dot_framework_dot_mediapipe__options__pb2._MEDIAPIPEOPTIONS
+_OUTPUTSTREAMHANDLERCONFIG.fields_by_name['options'].message_type = mediapipe_dot_framework_dot_mediapipe__options__pb2._MEDIAPIPEOPTIONS
+DESCRIPTOR.message_types_by_name['InputStreamHandlerConfig'] = _INPUTSTREAMHANDLERCONFIG
+DESCRIPTOR.message_types_by_name['OutputStreamHandlerConfig'] = _OUTPUTSTREAMHANDLERCONFIG
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+InputStreamHandlerConfig = _reflection.GeneratedProtocolMessageType('InputStreamHandlerConfig', (_message.Message,), dict(
+ DESCRIPTOR = _INPUTSTREAMHANDLERCONFIG,
+ __module__ = 'mediapipe.framework.stream_handler_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.InputStreamHandlerConfig)
+ ))
+_sym_db.RegisterMessage(InputStreamHandlerConfig)
+
+OutputStreamHandlerConfig = _reflection.GeneratedProtocolMessageType('OutputStreamHandlerConfig', (_message.Message,), dict(
+ DESCRIPTOR = _OUTPUTSTREAMHANDLERCONFIG,
+ __module__ = 'mediapipe.framework.stream_handler_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.OutputStreamHandlerConfig)
+ ))
+_sym_db.RegisterMessage(OutputStreamHandlerConfig)
+
+
+DESCRIPTOR._options = None
+# @@protoc_insertion_point(module_scope)
diff --git a/src/p2/tools/test_calculators_pb2.py b/src/p2/tools/test_calculators_pb2.py
new file mode 100644
index 0000000..3df94de
--- /dev/null
+++ b/src/p2/tools/test_calculators_pb2.py
@@ -0,0 +1,113 @@
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: mediapipe/framework/test_calculators.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from mediapipe.framework import calculator_pb2 as mediapipe_dot_framework_dot_calculator__pb2
+try:
+ mediapipe_dot_framework_dot_calculator__options__pb2 = mediapipe_dot_framework_dot_calculator__pb2.mediapipe_dot_framework_dot_calculator__options__pb2
+except AttributeError:
+ mediapipe_dot_framework_dot_calculator__options__pb2 = mediapipe_dot_framework_dot_calculator__pb2.mediapipe.framework.calculator_options_pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+ name='mediapipe/framework/test_calculators.proto',
+ package='mediapipe',
+ syntax='proto2',
+ serialized_options=None,
+ serialized_pb=_b('\n*mediapipe/framework/test_calculators.proto\x12\tmediapipe\x1a$mediapipe/framework/calculator.proto\"\xdd\x01\n\x1dRandomMatrixCalculatorOptions\x12\x0c\n\x04rows\x18\x01 \x01(\x05\x12\x0c\n\x04\x63ols\x18\x02 \x01(\x05\x12\x17\n\x0fstart_timestamp\x18\x03 \x01(\x03\x12\x17\n\x0flimit_timestamp\x18\x04 \x01(\x03\x12\x16\n\x0etimestamp_step\x18\x05 \x01(\x03\x32V\n\x03\x65xt\x12\x1c.mediapipe.CalculatorOptions\x18\xc8\xa0\xe9\x18 \x01(\x0b\x32(.mediapipe.RandomMatrixCalculatorOptions')
+ ,
+ dependencies=[mediapipe_dot_framework_dot_calculator__pb2.DESCRIPTOR,])
+
+
+
+
+_RANDOMMATRIXCALCULATOROPTIONS = _descriptor.Descriptor(
+ name='RandomMatrixCalculatorOptions',
+ full_name='mediapipe.RandomMatrixCalculatorOptions',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='rows', full_name='mediapipe.RandomMatrixCalculatorOptions.rows', index=0,
+ number=1, type=5, cpp_type=1, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='cols', full_name='mediapipe.RandomMatrixCalculatorOptions.cols', index=1,
+ number=2, type=5, cpp_type=1, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='start_timestamp', full_name='mediapipe.RandomMatrixCalculatorOptions.start_timestamp', index=2,
+ number=3, type=3, cpp_type=2, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='limit_timestamp', full_name='mediapipe.RandomMatrixCalculatorOptions.limit_timestamp', index=3,
+ number=4, type=3, cpp_type=2, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='timestamp_step', full_name='mediapipe.RandomMatrixCalculatorOptions.timestamp_step', index=4,
+ number=5, type=3, cpp_type=2, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ _descriptor.FieldDescriptor(
+ name='ext', full_name='mediapipe.RandomMatrixCalculatorOptions.ext', index=0,
+ number=52056136, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=True, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto2',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=96,
+ serialized_end=317,
+)
+
+DESCRIPTOR.message_types_by_name['RandomMatrixCalculatorOptions'] = _RANDOMMATRIXCALCULATOROPTIONS
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+RandomMatrixCalculatorOptions = _reflection.GeneratedProtocolMessageType('RandomMatrixCalculatorOptions', (_message.Message,), dict(
+ DESCRIPTOR = _RANDOMMATRIXCALCULATOROPTIONS,
+ __module__ = 'mediapipe.framework.test_calculators_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.RandomMatrixCalculatorOptions)
+ ))
+_sym_db.RegisterMessage(RandomMatrixCalculatorOptions)
+
+_RANDOMMATRIXCALCULATOROPTIONS.extensions_by_name['ext'].message_type = _RANDOMMATRIXCALCULATOROPTIONS
+mediapipe_dot_framework_dot_calculator__options__pb2.CalculatorOptions.RegisterExtension(_RANDOMMATRIXCALCULATOROPTIONS.extensions_by_name['ext'])
+
+# @@protoc_insertion_point(module_scope)
diff --git a/src/p2/tools/thread_pool_executor_pb2.py b/src/p2/tools/thread_pool_executor_pb2.py
new file mode 100644
index 0000000..7aafb40
--- /dev/null
+++ b/src/p2/tools/thread_pool_executor_pb2.py
@@ -0,0 +1,138 @@
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: mediapipe/framework/thread_pool_executor.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from mediapipe.framework import mediapipe_options_pb2 as mediapipe_dot_framework_dot_mediapipe__options__pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+ name='mediapipe/framework/thread_pool_executor.proto',
+ package='mediapipe',
+ syntax='proto2',
+ serialized_options=None,
+ serialized_pb=_b('\n.mediapipe/framework/thread_pool_executor.proto\x12\tmediapipe\x1a+mediapipe/framework/mediapipe_options.proto\"\xe9\x02\n\x19ThreadPoolExecutorOptions\x12\x13\n\x0bnum_threads\x18\x01 \x01(\x05\x12\x12\n\nstack_size\x18\x02 \x01(\x05\x12\x1b\n\x13nice_priority_level\x18\x03 \x01(\x05\x12`\n\x1drequire_processor_performance\x18\x04 \x01(\x0e\x32\x39.mediapipe.ThreadPoolExecutorOptions.ProcessorPerformance\x12\x1a\n\x12thread_name_prefix\x18\x05 \x01(\t\"5\n\x14ProcessorPerformance\x12\n\n\x06NORMAL\x10\x00\x12\x07\n\x03LOW\x10\x01\x12\x08\n\x04HIGH\x10\x02\x32Q\n\x03\x65xt\x12\x1b.mediapipe.MediaPipeOptions\x18\x93\xd3\xf5J \x01(\x0b\x32$.mediapipe.ThreadPoolExecutorOptions')
+ ,
+ dependencies=[mediapipe_dot_framework_dot_mediapipe__options__pb2.DESCRIPTOR,])
+
+
+
+_THREADPOOLEXECUTOROPTIONS_PROCESSORPERFORMANCE = _descriptor.EnumDescriptor(
+ name='ProcessorPerformance',
+ full_name='mediapipe.ThreadPoolExecutorOptions.ProcessorPerformance',
+ filename=None,
+ file=DESCRIPTOR,
+ values=[
+ _descriptor.EnumValueDescriptor(
+ name='NORMAL', index=0, number=0,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='LOW', index=1, number=1,
+ serialized_options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='HIGH', index=2, number=2,
+ serialized_options=None,
+ type=None),
+ ],
+ containing_type=None,
+ serialized_options=None,
+ serialized_start=332,
+ serialized_end=385,
+)
+_sym_db.RegisterEnumDescriptor(_THREADPOOLEXECUTOROPTIONS_PROCESSORPERFORMANCE)
+
+
+_THREADPOOLEXECUTOROPTIONS = _descriptor.Descriptor(
+ name='ThreadPoolExecutorOptions',
+ full_name='mediapipe.ThreadPoolExecutorOptions',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='num_threads', full_name='mediapipe.ThreadPoolExecutorOptions.num_threads', index=0,
+ number=1, type=5, cpp_type=1, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='stack_size', full_name='mediapipe.ThreadPoolExecutorOptions.stack_size', index=1,
+ number=2, type=5, cpp_type=1, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='nice_priority_level', full_name='mediapipe.ThreadPoolExecutorOptions.nice_priority_level', index=2,
+ number=3, type=5, cpp_type=1, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='require_processor_performance', full_name='mediapipe.ThreadPoolExecutorOptions.require_processor_performance', index=3,
+ number=4, type=14, cpp_type=8, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ _descriptor.FieldDescriptor(
+ name='thread_name_prefix', full_name='mediapipe.ThreadPoolExecutorOptions.thread_name_prefix', index=4,
+ number=5, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ extensions=[
+ _descriptor.FieldDescriptor(
+ name='ext', full_name='mediapipe.ThreadPoolExecutorOptions.ext', index=0,
+ number=157116819, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=True, extension_scope=None,
+ serialized_options=None, file=DESCRIPTOR),
+ ],
+ nested_types=[],
+ enum_types=[
+ _THREADPOOLEXECUTOROPTIONS_PROCESSORPERFORMANCE,
+ ],
+ serialized_options=None,
+ is_extendable=False,
+ syntax='proto2',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=107,
+ serialized_end=468,
+)
+
+_THREADPOOLEXECUTOROPTIONS.fields_by_name['require_processor_performance'].enum_type = _THREADPOOLEXECUTOROPTIONS_PROCESSORPERFORMANCE
+_THREADPOOLEXECUTOROPTIONS_PROCESSORPERFORMANCE.containing_type = _THREADPOOLEXECUTOROPTIONS
+DESCRIPTOR.message_types_by_name['ThreadPoolExecutorOptions'] = _THREADPOOLEXECUTOROPTIONS
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+ThreadPoolExecutorOptions = _reflection.GeneratedProtocolMessageType('ThreadPoolExecutorOptions', (_message.Message,), dict(
+ DESCRIPTOR = _THREADPOOLEXECUTOROPTIONS,
+ __module__ = 'mediapipe.framework.thread_pool_executor_pb2'
+ # @@protoc_insertion_point(class_scope:mediapipe.ThreadPoolExecutorOptions)
+ ))
+_sym_db.RegisterMessage(ThreadPoolExecutorOptions)
+
+_THREADPOOLEXECUTOROPTIONS.extensions_by_name['ext'].message_type = _THREADPOOLEXECUTOROPTIONS
+mediapipe_dot_framework_dot_mediapipe__options__pb2.MediaPipeOptions.RegisterExtension(_THREADPOOLEXECUTOROPTIONS.extensions_by_name['ext'])
+
+# @@protoc_insertion_point(module_scope)
diff --git a/src/p2/train.py b/src/p2/train.py
new file mode 100644
index 0000000..634b8c6
--- /dev/null
+++ b/src/p2/train.py
@@ -0,0 +1,115 @@
+import csv
+import random
+import tensorflow as tf
+import os
+column_names = []
+
+train_feature=[]
+train_label=[]
+test_feature=[]
+test_label=[]
+
+with open("test.csv","r") as r:
+ reader = csv.reader(r)
+ for i in reader:
+ rand = random.randint(0,100)
+ if rand<=85:
+ train_label.append((eval(i.pop())))
+ b = [eval(j) for j in i]
+ train_feature.append(b)
+ else:
+ test_label.append((eval(i.pop())))
+ b = [eval(j) for j in i]
+ test_feature.append(b)
+train_features = tf.constant(train_feature)
+train_labels = tf.constant(train_label)
+test_features = tf.constant(test_feature)
+test_labels = tf.constant(test_label)
+
+
+model = tf.keras.Sequential([
+ tf.keras.layers.Flatten(input_shape=(252,)),
+ tf.keras.layers.Dense(10, activation=tf.nn.relu), # input shape required
+ tf.keras.layers.Dense(10, activation=tf.nn.relu),
+ tf.keras.layers.Dense(6)
+])
+predictions = model(train_features)
+tf.nn.softmax(predictions[:5])
+print("Prediction: {}".format(tf.argmax(predictions, axis=1)))
+print(" Labels: {}".format(train_labels))
+loss_object = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True)
+
+def loss(model, x, y, training):
+ # training=training is needed only if there are layers with different
+ # behavior during training versus inference (e.g. Dropout).
+ y_ = model(x, training=training)
+
+ return loss_object(y_true=y, y_pred=y_)
+l = loss(model, train_features, train_labels, training=False)
+def grad(model, inputs, targets):
+ with tf.GradientTape() as tape:
+ loss_value = loss(model, inputs, targets, training=True)
+ return loss_value, tape.gradient(loss_value, model.trainable_variables)
+
+optimizer = tf.keras.optimizers.SGD(learning_rate=0.01)
+loss_value, grads = grad(model, train_features, train_labels)
+
+print("Step: {}, Initial Loss: {}".format(optimizer.iterations.numpy(),
+ loss_value.numpy()))
+
+optimizer.apply_gradients(zip(grads, model.trainable_variables))
+
+print("Step: {}, Loss: {}".format(optimizer.iterations.numpy(),
+ loss(model, train_features, train_labels, training=True).numpy()))
+
+## Note: Rerunning this cell uses the same model variables
+
+# Keep results for plotting
+train_loss_results = []
+train_accuracy_results = []
+
+num_epochs = 351
+
+for epoch in range(num_epochs):
+ epoch_loss_avg = tf.keras.metrics.Mean()
+ epoch_accuracy = tf.keras.metrics.SparseCategoricalAccuracy()
+
+ # Training loop - using batches of 32
+ branch = 32
+ for num in range(len(train_features)//branch):
+ x = train_features[num*branch:(num+1)*branch]
+ y = train_labels[num*branch:(num+1)*branch]
+ # Optimize the model
+ loss_value, grads = grad(model, x, y)
+ optimizer.apply_gradients(zip(grads, model.trainable_variables))
+
+ # Track progress
+ epoch_loss_avg.update_state(loss_value) # Add current batch loss
+ # Compare predicted label to actual label
+ # training=True is needed only if there are layers with different
+ # behavior during training versus inference (e.g. Dropout).
+ epoch_accuracy.update_state(y, model(x, training=True))
+
+ # End epoch
+ train_loss_results.append(epoch_loss_avg.result())
+ train_accuracy_results.append(epoch_accuracy.result())
+
+ if epoch % 50 == 0:
+ print("Epoch {:03d}: Loss: {:.3f}, Accuracy: {:.3%}".format(epoch,
+ epoch_loss_avg.result(),
+ epoch_accuracy.result()))
+
+test_accuracy = tf.keras.metrics.Accuracy()
+model.save("model")
+
+for num in range(len(test_features)):
+ # training=False is needed only if there are layers with different
+ # behavior during training versus inference (e.g. Dropout).
+ x = test_features[num:num+1]
+ y = test_labels[num:num+1]
+ logits = model(x, training=False)
+ prediction = tf.argmax(logits, axis=1, output_type=tf.int32)
+ print("真实值为",y,"预测值为",prediction)
+ test_accuracy(prediction, y)
+
+print("Test set accuracy: {:.3%}".format(test_accuracy.result()))
\ No newline at end of file