"The difficult thing isn't living with other people, it's understanding them."
-- José Saramago, Blindness
YiDong is designed to facilitate seamless interaction with the Yi series multi-modal models, enabling users to perform a variety of tasks including image/video comprehension, creation, and modification.
Make sure you have a valid API key.
We provide SDK in the following programming languages:
- Python
-
Install the
yidong
package:pip install yidong
-
Initialize the client
from yidong import YiDong yd = YiDong(api_key="YOUR_API_KEY")
You can also set the
YIDONG_API_KEY
environment variable instead and left theapi_key
param empty. -
Upload resources
r = yd.add_resource("path/to/your/video.mp4")
A resource ID will be returned once the upload is completed.
-
Perform tasks
t = yd.submit_task(VideoSummaryTask(video_id=r.id)) print(t())
For more examples, please visit the Gradio Example(TODO: Add Link).
You can also use the command line interface to perform tasks demonstrated above:
$ yidong add_resource path/to/your/video.mp4
$ yidong submit_task VideoSummaryTask --video_id YOUR_VIDEO_ID