Skip to content

Commit e4a137f

Browse files
committed
Replace flag with not no_images for clarity
Co-authored-by: Net Zhang
1 parent af6eeb8 commit e4a137f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/kabr_tools/cvat2slowfast.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def cvat2slowfast(path_to_mini_scenes: str, path_to_new_dataset: str,
3939
charades_df = pd.DataFrame(data=headers)
4040
video_id = 1
4141
folder_name = 1
42-
flag = not no_images
4342

4443
for i, folder in enumerate(natsorted(os.listdir(path_to_mini_scenes))):
4544
if os.path.exists(f"{path_to_mini_scenes}/{folder}/actions"):
@@ -105,7 +104,7 @@ def cvat2slowfast(path_to_mini_scenes: str, path_to_new_dataset: str,
105104
size = int(vc.get(cv2.CAP_PROP_FRAME_COUNT))
106105

107106
while vc.isOpened():
108-
if flag is False:
107+
if no_images:
109108
if index < size:
110109
returned = True
111110
frame = None
@@ -125,7 +124,7 @@ def cvat2slowfast(path_to_mini_scenes: str, path_to_new_dataset: str,
125124
behavior = old2new[behavior]
126125

127126
if behavior in label2number.keys():
128-
if flag:
127+
if not no_images:
129128
cv2.imwrite(f"{output_folder}/{adjusted_index}.jpg", frame)
130129

131130
# TODO: Major slow down here. Add to a list rather than dataframe,

0 commit comments

Comments
 (0)