当前位置: 首页 > news >正文

公司网站重新建站通知学编程的正规学校

公司网站重新建站通知,学编程的正规学校,企业所得税税收筹划,小程序直播FancyVideo是一个由360AI团队和中山大学联合开发并开源的视频生成模型。 FancyVideo的创新之处在于它能够实现帧特定的文本指导,使得生成的视频既动态又具有一致性。 FancyVideo模型通过精心设计的跨帧文本引导模块(Cross-frame Textual Guidance Modu…

FancyVideo是一个由360AI团队和中山大学联合开发并开源的视频生成模型。

FancyVideo的创新之处在于它能够实现帧特定的文本指导,使得生成的视频既动态又具有一致性。

FancyVideo模型通过精心设计的跨帧文本引导模块(Cross-frame Textual Guidance Module, CTGM)改进了现有的文本控制机制,以解决现有文本到视频(T2V)模型在生成具有连贯运动视频时面临的挑战。

CTGM包含三个子模块:时间信息注入器(Temporal Information Injector, TII)、时间亲和力细化器(Temporal Affinity Refiner, TAR)和时间特征增强器(Temporal Feature Booster, TFB),分别在交叉注意的开始、中间和结束时实现帧特定文本指导。

FancyVideo在EvalCrafter基准测试上取得了最先进的T2V生成结果,并能够合成动态和一致的视频。

github项目地址:https://github.com/360CVGroup/FancyVideo。

一、环境安装

1、python环境

建议安装python版本在3.10以上。

2、pip库安装

pip install torch==2.1.2+cu118 torchvision==0.16.2+cu118 torchaudio==2.1.2 --extra-index-url https://download.pytorch.org/whl/cu118

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

3、fancyvideo模型下载

git lfs install

git clone https://huggingface.co/qihoo360/FancyVideo

4、stable-diffusion-v1-5模型下载

git lfs install

git clone https://huggingface.co/runwayml/stable-diffusion-v1-5

、功能测试

1、运行测试

(1)python代码调用测试

import os
import argparse
import torch
import yaml
from skimage import img_as_ubyte
from fancyvideo.pipelines.fancyvideo_infer_pipeline import InferPipelinedef load_config(config_path):with open(config_path, "r") as fp:return yaml.safe_load(fp)def load_prompts(prompt_path):with open(prompt_path, "r") as fp:return [line.strip() for line in fp.readlines()]def check_and_create_folder(folder_path):if not os.path.exists(folder_path):os.makedirs(folder_path, exist_ok=True)@torch.no_grad()
def process_prompt(infer_pipeline, prompt, reference_image_path, seed, video_length, resolution, use_noise_scheduler_snr, cond_fps, cond_motion_score, output_fps, dst_path):print(f"Processing prompt: {prompt}")reference_image, video, _ = infer_pipeline.t2v_process_one_prompt(prompt=prompt,reference_image_path=reference_image_path,seed=seed,video_length=video_length,resolution=resolution,use_noise_scheduler_snr=use_noise_scheduler_snr,fps=cond_fps,motion_score=cond_motion_score)frame_list = [img_as_ubyte(frame.cpu().permute(1, 2, 0).float().detach().numpy()) for frame in video]infer_pipeline.save_video(frame_list=frame_list, fps=output_fps, dst_path=dst_path)print(f"Saved video to: {dst_path}\n")@torch.no_grad()
def main(args):# Load configurationsconfig = load_config(args.config)model_config = config.get("model", {})infer_config = config.get("inference", {})# Initialize inference pipelineinfer_pipeline = InferPipeline(text_to_video_mm_path=model_config.get("text_to_video_mm_path"),base_model_path=model_config.get("base_model_path"),res_adapter_type=model_config.get("res_adapter_type"),trained_keys=model_config.get("trained_keys"),model_path=model_config.get("model_path"),vae_type=model_config.get("vae_type"),use_fps_embedding=model_config.get("use_fps_embedding"),use_motion_embedding=model_config.get("use_motion_embedding"),common_positive_prompt=model_config.get("common_positive_prompt"),common_negative_prompt=model_config.get("common_negative_prompt"),)# Prepare inference parametersinfer_mode = infer_config.get("infer_mode")resolution = infer_config.get("resolution")video_length = infer_config.get("video_length")output_fps = infer_config.get("output_fps")cond_fps = infer_config.get("cond_fps")cond_motion_score = infer_config.get("cond_motion_score")use_noise_scheduler_snr = infer_config.get("use_noise_scheduler_snr")seed = infer_config.get("seed")prompt_path = infer_config.get("prompt_path")reference_image_folder = infer_config.get("reference_image_folder")output_folder = infer_config.get("output_folder")check_and_create_folder(output_folder)# Load promptsprompts = load_prompts(prompt_path)# Process each promptfor i, prompt in enumerate(prompts):reference_image_path = f"{reference_image_folder}/{i}.png" if infer_mode == "i2v" else ""dst_path = f"{output_folder}/example_{i}.mp4"process_prompt(infer_pipeline, prompt, reference_image_path, seed, video_length, resolution, use_noise_scheduler_snr, cond_fps, cond_motion_score, output_fps, dst_path)if __name__ == "__main__":parser = argparse.ArgumentParser()parser.add_argument("--config", type=str, default="configs/inference/i2v.yaml", help="Path to the configuration file")args = parser.parse_args()main(args)

未完......

更多详细的欢迎关注:杰哥新技术

http://www.dinnco.com/news/36754.html

相关文章:

  • 品牌建设网站公司排名美食软文300字
  • 21天网站建设实录pdf百度关键词价格
  • 销售型网站如何做推广长沙优化排名
  • 做网站选云服务器内核外贸网站推广与优化
  • 动态网站开发服务器端脚本语言百度榜单
  • 手机网站设计开发电商网络营销
  • 新闻网页设计模板东莞seo搜索
  • 巢湖网站建设公司江东怎样优化seo
  • 高邮建设银行网站关键词林俊杰无损下载
  • 网站的ui规范百度seo排名优化技巧分享
  • b2c模式的电商网站青岛seo关键词优化排名
  • 下载中心软件seo关键词平台
  • 90设计网站免费素材网络营销包括几个部分
  • 我国地方政府网站建设史电子商务网站建设与管理
  • 做网站需要一些什么工具百度推广开户
  • 网站主机选择十大计算机培训机构排名
  • 沈阳微网站广西网络优化seo
  • 深圳外贸公司招聘信息网站seo的方法
  • 电商的推广方式有哪些成都官网seo厂家
  • 可以做 描文本链接的网站百度推广哪种效果好
  • 响应式网站的设计尺寸网站注册流程
  • 济宁君天建设公司网站腾讯企点怎么注册
  • 网站建设图标图片百度seo排名主要看啥
  • 做爰动态视频网站安卓手机性能优化软件
  • apache php wordpress北京seo推广服务
  • 怎样给网站做外链全网营销国际系统
  • 网站不备案可以建设吗百度指数怎样使用
  • 网站免费做招生宣传语刷钻业务推广网站
  • 创建网站哪个好经典软文案例和扶贫农产品软文
  • 宝坻网站建设抖音seo怎么做