Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 2547015

Browse files
Fix json loading without clip_path
1 parent fb6beda commit 2547015

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

utils/dataset.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@ def build_json(self, json_data):
130130
return json_data
131131

132132
def build_json_dict(self, data, nested_data, extended_data):
133-
clip_path = 'clip_path' if 'clip_path' in nested_data else None
134-
133+
clip_path = nested_data['clip_path'] if 'clip_path' in nested_data else None
134+
135135
extended_data.append({
136136
self.vid_data_key: data[self.vid_data_key],
137137
'frame_index': nested_data['frame_index'],
138138
'prompt': nested_data['prompt'],
139-
'clip_path': nested_data['clip_path']
139+
'clip_path': clip_path
140140
})
141141

142142
def load_from_json(self, path, json_data):
@@ -202,7 +202,8 @@ def process_video_wrapper(self, vid_path):
202202
def train_data_batch(self, index):
203203

204204
# If we are training on individual clips.
205-
if 'clip_path' in self.train_data[index]:
205+
if 'clip_path' in self.train_data[index] and \
206+
self.train_data[index]['clip_path'] is not None:
206207

207208
vid_data = self.train_data[index]
208209

0 commit comments

Comments
 (0)