apply Black 25.11.0 style in fbcode/deeplearning/projects (21/92)

Summary:
Formats the covered files with pyfmt.

paintitblack

Reviewed By: itamaro

Differential Revision: D90476315

fbshipit-source-id: ee94c471788b8e7d067813d8b3e0311214d17f3f
This commit is contained in:
Bowie Chen
2026-01-11 23:16:49 -08:00
committed by meta-codesync[bot]
parent 7b89b8fc3f
commit 11dec2936d
69 changed files with 445 additions and 522 deletions

View File

@@ -11,7 +11,6 @@ from concurrent.futures import as_completed, ThreadPoolExecutor
from pathlib import Path
import yt_dlp
from utils import (
annotation_files,
config,
@@ -244,9 +243,9 @@ def download_sav():
def main():
assert len(sys.argv) > 1, "You have to provide the name of the dataset"
dataset_name = sys.argv[1]
assert (
dataset_name in annotation_files
), f"The dataset can be one of {list(annotation_files.keys())}"
assert dataset_name in annotation_files, (
f"The dataset can be one of {list(annotation_files.keys())}"
)
if dataset_name == "yt1b":
download_youtube()

View File

@@ -68,9 +68,9 @@ def process_image(args):
def main():
assert len(sys.argv) > 1, "You have to provide the name of the dataset"
dataset_name = sys.argv[1]
assert (
dataset_name in annotation_files
), f"The dataset can be one of {list(annotation_files.keys())}"
assert dataset_name in annotation_files, (
f"The dataset can be one of {list(annotation_files.keys())}"
)
all_outputs = []
for file in annotation_files[dataset_name]:
with open(os.path.join(config["path_annotations"], file), "r") as f:

View File

@@ -51,7 +51,7 @@ def main(args, n_workers=20):
paths = [
(
raw_folder_food_images
/ f'{Path(each).stem.split("_")[-1]}{Path(each).suffix}',
/ f"{Path(each).stem.split('_')[-1]}{Path(each).suffix}",
processed_folder / each,
)
for each in img_filenames

View File

@@ -3,7 +3,6 @@
# pyre-unsafe
import argparse
import logging
import multiprocessing as mp
import os
from functools import partial

View File

@@ -58,9 +58,9 @@ class YtVideoPrep:
df = self.yt1b_start_end_time_df[
self.yt1b_start_end_time_df.saco_yt1b_id == self.saco_yt1b_id
]
assert (
len(df) == 1
), f"Expected exactly 1 row for saco_yt1b_id: {self.saco_yt1b_id}, found {len(df)}"
assert len(df) == 1, (
f"Expected exactly 1 row for saco_yt1b_id: {self.saco_yt1b_id}, found {len(df)}"
)
id_and_frame_map_row = df.iloc[0]
yt_video_id = (
@@ -82,9 +82,9 @@ class YtVideoPrep:
def download_youtube_video(self):
video_url = f"https://youtube.com/watch?v={self.yt_video_id}"
assert os.path.exists(
self.cookies_file
), f"Cookies file '{self.cookies_file}' not found. Must have it to download videos."
assert os.path.exists(self.cookies_file), (
f"Cookies file '{self.cookies_file}' not found. Must have it to download videos."
)
outtmpl = self.raw_video_path