From ef49bb4d12a73434026f9e62ea918098ff35d649 Mon Sep 17 00:00:00 2001 From: thr Date: Thu, 18 Dec 2025 15:28:53 +0800 Subject: [PATCH] docs(docs/LLaVA_Video_1003.md) update: Fix Inference demo: load_video function parameter and max_frames_num type Fix code in Inference demo: load_video method signature and parameter type - Corrected load_video method signature by removing incorrect 'self' parameter - Fixed max_frames_num parameter type from string "64" to integer 64 --- docs/LLaVA_Video_1003.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/LLaVA_Video_1003.md b/docs/LLaVA_Video_1003.md index 5810e51ac..10105444b 100644 --- a/docs/LLaVA_Video_1003.md +++ b/docs/LLaVA_Video_1003.md @@ -32,7 +32,7 @@ import warnings from decord import VideoReader, cpu import numpy as np warnings.filterwarnings("ignore") -def load_video(self, video_path, max_frames_num,fps=1,force_sample=False): +def load_video(video_path, max_frames_num,fps=1,force_sample=False): if max_frames_num == 0: return np.zeros((1, 336, 336, 3)) vr = VideoReader(video_path, ctx=cpu(0),num_threads=1) @@ -57,7 +57,7 @@ device_map = "auto" tokenizer, model, image_processor, max_length = load_pretrained_model(pretrained, None, model_name, torch_dtype="bfloat16", device_map=device_map) # Add any other thing you want to pass in llava_model_args model.eval() video_path = "XXXX" -max_frames_num = "64" +max_frames_num = 64 video,frame_time,video_time = load_video(video_path, max_frames_num, 1, force_sample=True) video = image_processor.preprocess(video, return_tensors="pt")["pixel_values"].cuda().bfloat16() video = [video]