ClarifAI Python API :将从网络摄像头捕获的图像传递到 API,而不保存在硬盘上

ClarifAI Python API : Passing image captured from Webcam, to API, without saving on hard drive

我正在使用 ClarifAI python API 对从我的 Raspberry PI 相机捕获的对象进行分类。 (整个程序在 python 上运行 raspberry PI)。

现在,可以使用此 [Python API] 的两种方式是:

1> passing the path of the image in hard drive as argument while calling API.
2> passing the URL of the image as argument while calling API.

现在,我想直接将我的 Pi Camera 使用 picamera library 拍摄的图像传递给这个 API,并获取标签,而不将其保存在硬盘上。我该怎么做?
我应该使用哪种变量来存储图像数据并传递它?

看起来有几种方法可以解决这个问题。

1) 使用capture function in picamera保存文件,将文件推送到Clarifai的函数tag_images,然后从驱动器中删除文件

2) Post 捕获图像的字节到 Imgur(或类似的)API 并将结果 URL 推送到 Clarifai 的 tag_image_urls 函数

3) 使用 REST 而不是 Clarifai Python 库并将图像字节推送到 /tag endpoint