Artiprocher / DiffSynth-Studio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please help,why IndexError: 2400?

randompaga opened this issue · comments

input_video = [video[i] for i in range(40*60 41*60)]

File "/code/./diffsynth/data/video.py", line 121, in getitem
frame = self.data.getitem(item)
File "/code/./diffsynth/data/video.py", line 15, in getitem
return Image.fromarray(np.array(self.reader.get_data(item))).convert("RGB")
File "/opt/conda/lib/python3.10/site-packages/imageio/core/format.py", line 437, in get_data
raise IndexError(index)
IndexError: 2400

input_video = [video[i] for i in range(40*60 41*60)]

File "/code/./diffsynth/data/video.py", line 121, in getitem frame = self.data.getitem(item) File "/code/./diffsynth/data/video.py", line 15, in getitem return Image.fromarray(np.array(self.reader.get_data(item))).convert("RGB") File "/opt/conda/lib/python3.10/site-packages/imageio/core/format.py", line 437, in get_data raise IndexError(index) IndexError: 2400

maybe your video do not have 40*60=2400 frames

还有一个办法,就是利用ffmpeg提前切割视频,然后传入VideoData对应的image folder

In this example, we use the frames starting from the 40th frame and ending at 41th frame. If you want to use the first 60 frames, you need to modify the code.

input_video = [video[i] for i in range(0, 60)]

Sorry for the late reply, I was very busy recently.

Sorry for the late reply, I was very busy recently.

THANKS!!!

frames

Yeah,you're right.

还有一个办法,就是利用ffmpeg提前切割视频,然后传入VideoData对应的image folder

Thanks for your help.