def item_seen(frame):
global sess, max_images, current_images, label
# DIRTY!!
imageio.imwrite('picture_out.jpg', frame)
image = run_inference_on_image('picture_out.jpg', sess)
if image != "without" and image == label:
current_images += 1
else:
current_images = 0
label = image
if current_images > max_images:
print("This is the label yaaaaaaaaaaaaaa {}".format(image))
current_images = max_images
return image
else:
print("No Still Nothing useful although I am seeing {}".format(image))
return "without"
# maybe resize?
#(w, h, c) = frame.shape
#scipy.misc.imresize(np.asarray(frame), min(200.0 / w, 200.0 / h))
#return run_inference_on_image(np.asarray(frame))
# method to write the gif
评论列表
文章目录