zhipuai-platform-video


Namezhipuai-platform-video JSON
Version 0.0.4 PyPI version JSON
download
home_pageNone
SummaryZhipuAI 开放平台视频生成插件
upload_time2024-07-29 06:34:34
maintainerNone
docs_urlNone
authorZhipu AI
requires_python<3.12,>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            #### 开放平台视频生成批量操作

#### 1. 项目简介
本项目是基于开放平台的视频生成批量操作,主要包括视频生成功能,提交包含input_text,image_path字段的的level_contexts.xlsx文件

input_text:文本内容
image_path: 图片绝对路径

输出结果为视频任务id


#### 使用
python 需要3.10以上版本

- 安装依赖
```shell
pip install zhipuai-platform-video -U

```


- 设置环境变量
```shell
export ZHIPUAI_API_KEY="开放平台key" 
```

- 运行

> 启动目录为项目根目录

```shell
python -m zhipuai_platform_video.start --input_excel C:\\Users\\renrui\\Desktop\\data\\level_contexts.xlsx --output_path C:\\Users\\renrui\\Desktop\\data\\
```

> 参数说明
> 
> input_excel:为包含input_text,image_path字段的的level_contexts.xlsx文件
> 
> output_path:为输出文件路径,生成 video_report.csv文件
> 
> 可以断点续传,会自动跳过已经生成的任务, 
> 
> 根据需要配置线程
> 
> prompt_num_threads: 提示词线程数,默认2
> 
> video_num_threads: 视频生成线程数,默认1
> 

- 获取任务结果 

> 启动目录为项目根目录
```shell
python -m zhipuai_platform_video.video_pull --task_video_csv C:\\Users\\renrui\\Desktop\\data\\video_report.csv --output_path C:\\Users\\renrui\\Desktop\\data\\
```
> 参数说明
> 
> input_excel: video_report.csv文件
> 
> output_path:为输出文件路径 生成video_pull_report.csv文件
> 
> 会自动跳过已经获取的任务, 删除根目录cache_data/VideoPullGenerator的文件可以重新获取
> 
> 根据需要配置线程
> 
> num_threads: 线程数,默认2
> 


- 下载视频 

> 启动目录为项目根目录
```shell
python -m zhipuai_platform_video.download_video  --csv_file_path  C:\\Users\\renrui\\Desktop\\data\\video_pull_report.csv --output_path C:\\Users\\renrui\\Desktop\\data\\

```
> 参数说明
> 
> csv_file_path: video_pull_report.csv文件
> 
> output_path:为输出文件路径 视频下载目录
>   
> 

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "zhipuai-platform-video",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.12,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Zhipu AI",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/9e/f9/ec60201232a62771cc341dd30167a7c385c76d2b99f4104a6d73e263b700/zhipuai_platform_video-0.0.4.tar.gz",
    "platform": null,
    "description": "#### \u5f00\u653e\u5e73\u53f0\u89c6\u9891\u751f\u6210\u6279\u91cf\u64cd\u4f5c\n\n#### 1. \u9879\u76ee\u7b80\u4ecb\n\u672c\u9879\u76ee\u662f\u57fa\u4e8e\u5f00\u653e\u5e73\u53f0\u7684\u89c6\u9891\u751f\u6210\u6279\u91cf\u64cd\u4f5c\uff0c\u4e3b\u8981\u5305\u62ec\u89c6\u9891\u751f\u6210\u529f\u80fd\uff0c\u63d0\u4ea4\u5305\u542binput_text,image_path\u5b57\u6bb5\u7684\u7684level_contexts.xlsx\u6587\u4ef6\n\ninput_text\uff1a\u6587\u672c\u5185\u5bb9\nimage_path: \u56fe\u7247\u7edd\u5bf9\u8def\u5f84\n\n\u8f93\u51fa\u7ed3\u679c\u4e3a\u89c6\u9891\u4efb\u52a1id\n\n\n#### \u4f7f\u7528\npython \u9700\u89813.10\u4ee5\u4e0a\u7248\u672c\n\n- \u5b89\u88c5\u4f9d\u8d56\n```shell\npip install zhipuai-platform-video -U\n\n```\n\n\n- \u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\n```shell\nexport ZHIPUAI_API_KEY=\"\u5f00\u653e\u5e73\u53f0key\" \n```\n\n- \u8fd0\u884c\n\n> \u542f\u52a8\u76ee\u5f55\u4e3a\u9879\u76ee\u6839\u76ee\u5f55\n\n```shell\npython -m zhipuai_platform_video.start --input_excel C:\\\\Users\\\\renrui\\\\Desktop\\\\data\\\\level_contexts.xlsx --output_path C:\\\\Users\\\\renrui\\\\Desktop\\\\data\\\\\n```\n\n> \u53c2\u6570\u8bf4\u660e\n> \n> input_excel\uff1a\u4e3a\u5305\u542binput_text,image_path\u5b57\u6bb5\u7684\u7684level_contexts.xlsx\u6587\u4ef6\n> \n> output_path\uff1a\u4e3a\u8f93\u51fa\u6587\u4ef6\u8def\u5f84\uff0c\u751f\u6210 video_report.csv\u6587\u4ef6\n> \n> \u53ef\u4ee5\u65ad\u70b9\u7eed\u4f20\uff0c\u4f1a\u81ea\u52a8\u8df3\u8fc7\u5df2\u7ecf\u751f\u6210\u7684\u4efb\u52a1, \n> \n> \u6839\u636e\u9700\u8981\u914d\u7f6e\u7ebf\u7a0b\n> \n> prompt_num_threads: \u63d0\u793a\u8bcd\u7ebf\u7a0b\u6570,\u9ed8\u8ba42\n> \n> video_num_threads: \u89c6\u9891\u751f\u6210\u7ebf\u7a0b\u6570,\u9ed8\u8ba41\n> \n\n- \u83b7\u53d6\u4efb\u52a1\u7ed3\u679c \n\n> \u542f\u52a8\u76ee\u5f55\u4e3a\u9879\u76ee\u6839\u76ee\u5f55\n```shell\npython -m zhipuai_platform_video.video_pull --task_video_csv C:\\\\Users\\\\renrui\\\\Desktop\\\\data\\\\video_report.csv --output_path C:\\\\Users\\\\renrui\\\\Desktop\\\\data\\\\\n```\n> \u53c2\u6570\u8bf4\u660e\n> \n> input_excel\uff1a video_report.csv\u6587\u4ef6\n> \n> output_path\uff1a\u4e3a\u8f93\u51fa\u6587\u4ef6\u8def\u5f84 \u751f\u6210video_pull_report.csv\u6587\u4ef6\n> \n> \u4f1a\u81ea\u52a8\u8df3\u8fc7\u5df2\u7ecf\u83b7\u53d6\u7684\u4efb\u52a1, \u5220\u9664\u6839\u76ee\u5f55cache_data/VideoPullGenerator\u7684\u6587\u4ef6\u53ef\u4ee5\u91cd\u65b0\u83b7\u53d6\n> \n> \u6839\u636e\u9700\u8981\u914d\u7f6e\u7ebf\u7a0b\n> \n> num_threads: \u7ebf\u7a0b\u6570,\u9ed8\u8ba42\n> \n\n\n- \u4e0b\u8f7d\u89c6\u9891 \n\n> \u542f\u52a8\u76ee\u5f55\u4e3a\u9879\u76ee\u6839\u76ee\u5f55\n```shell\npython -m zhipuai_platform_video.download_video  --csv_file_path  C:\\\\Users\\\\renrui\\\\Desktop\\\\data\\\\video_pull_report.csv --output_path C:\\\\Users\\\\renrui\\\\Desktop\\\\data\\\\\n\n```\n> \u53c2\u6570\u8bf4\u660e\n> \n> csv_file_path\uff1a video_pull_report.csv\u6587\u4ef6\n> \n> output_path\uff1a\u4e3a\u8f93\u51fa\u6587\u4ef6\u8def\u5f84 \u89c6\u9891\u4e0b\u8f7d\u76ee\u5f55\n>   \n> \n",
    "bugtrack_url": null,
    "license": null,
    "summary": "ZhipuAI \u5f00\u653e\u5e73\u53f0\u89c6\u9891\u751f\u6210\u63d2\u4ef6",
    "version": "0.0.4",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3a0e47a1b5047a2840025f08cf86a12573ca4ebbdda5dfb02e335cd0a78ef94a",
                "md5": "7aa1676b51797573c00f793fb617d5da",
                "sha256": "66712a7abf988b0428aedf5f02b49303979143581f73dd1f1aedb62dd67b2a94"
            },
            "downloads": -1,
            "filename": "zhipuai_platform_video-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7aa1676b51797573c00f793fb617d5da",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.12,>=3.10",
            "size": 17560,
            "upload_time": "2024-07-29T06:34:33",
            "upload_time_iso_8601": "2024-07-29T06:34:33.892369Z",
            "url": "https://files.pythonhosted.org/packages/3a/0e/47a1b5047a2840025f08cf86a12573ca4ebbdda5dfb02e335cd0a78ef94a/zhipuai_platform_video-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9ef9ec60201232a62771cc341dd30167a7c385c76d2b99f4104a6d73e263b700",
                "md5": "f5e9aae468e408cc3e8f7c29aa55e3ca",
                "sha256": "154b455a01a2ff677f2e3e3db854176795ab7ebc49754679cacac40d7dcdab78"
            },
            "downloads": -1,
            "filename": "zhipuai_platform_video-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "f5e9aae468e408cc3e8f7c29aa55e3ca",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.12,>=3.10",
            "size": 11595,
            "upload_time": "2024-07-29T06:34:34",
            "upload_time_iso_8601": "2024-07-29T06:34:34.870177Z",
            "url": "https://files.pythonhosted.org/packages/9e/f9/ec60201232a62771cc341dd30167a7c385c76d2b99f4104a6d73e263b700/zhipuai_platform_video-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-29 06:34:34",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "zhipuai-platform-video"
}
        
Elapsed time: 1.77157s