Skip to content

Commit d6ec28c

Browse files
authored
Update conversation.py
1 parent 4ab172e commit d6ec28c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

video_chat2/conversation.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,8 @@ def load_video(self, video_path, num_segments=8, return_msg=False):
9797
num_frames = len(vr)
9898
frame_indices = self.get_index(num_frames, num_segments)
9999

100-
duration = len(vr) // vr.get_avg_fps()
101-
index = np.linspace(0, len(vr)-1, num=int(duration))
102-
buffer = vr.get_batch(index).asnumpy()
100+
#duration = len(vr) // vr.get_avg_fps()
101+
#index = np.linspace(0, len(vr)-1, num=int(duration))
103102
# transform
104103
input_mean = [0.48145466, 0.4578275, 0.40821073]
105104
input_std = [0.26862954, 0.26130258, 0.27577711]
@@ -112,10 +111,6 @@ def load_video(self, video_path, num_segments=8, return_msg=False):
112111
GroupNormalize(input_mean, input_std)
113112
])
114113

115-
images_group = list()
116-
for frame in buffer:
117-
img = Image.fromarray(frame)
118-
images_group.append(img)
119114
images_group = list()
120115
for frame_index in frame_indices:
121116
img = Image.fromarray(vr[frame_index].asnumpy())

0 commit comments

Comments
 (0)