Я работаю над системой распознавания языка жестов, которая берет живое видео с веб-камеры. Я использовал две системы для координации всей системы. Первая система дает ключевые точки и скелет руки пользователя языка жестов, а вторая система берет эти ключевые и скелетные данные и анализирует их, чтобы дать то, что пытается сказать говорящий на языке жестов. Поэтому моя проблема заключается в том, чтобы передать этот ключевой и скелетный видеофайл в аналитическую часть. Я не знаю, насколько ясна моя проблема, но мне очень нужна помощь.
Я уже пробовал несколько вещей, которые нашел в интернете, но ни одно из этих решений не работает.
cv2.imshow («Выходной скелет», кадр)
# cv2.imwrite ("video_output / {: 03d} .jpg" .format (k), frame)
key = cv2.waitKey(1)
if key == 27:
break
print("total = {}".format(time.time() - t))
vid_writer.write(frame)
def predict(image_data):
predictions = sess.run(softmax_tensor, \
{'DecodeJpeg/contents:0': image_data})
# Sort to show labels of first prediction in order of confidence
top_k = predictions[0].argsort()[-len(predictions[0]):][::-1]
max_score = 0.0
res = ''
for node_id in top_k:
human_string = label_lines[node_id]
score = predictions[0][node_id]
if score > max_score:
max_score = score
res = human_string
return res, max_score
# Loads label file, strips off carriage return
label_lines = [line.rstrip() for line in tf.gfile.GFile("logs/trained_labels.txt")]
# Unpersists graph from file
with tf.gfile.FastGFile("logs/trained_graph.pb", 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
_ = tf.import_graph_def(graph_def, name='')
with tf.Session() as sess:
# Feed the image_data as input to the graph and get first prediction
softmax_tensor = sess.graph.get_tensor_by_name('final_result:0')
c = 0
input_source = cv2.imshow('frame',frame1)
cap = cv2.VideoCapture(input_source)
res, score = '', 0.0
i = 0
mem = ''
consecutive = 0
sequence = ''