Skip to content

Commit

Permalink
format (hpcaitech#103)
Browse files Browse the repository at this point in the history
Co-authored-by: Shen-Chenhui <[email protected]>
  • Loading branch information
Shen-Chenhui and Shen-Chenhui authored May 15, 2024
1 parent ec41f39 commit ad32081
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/datasets/datautil.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,8 @@ def main(args):
print(f"Intersection csv contains {len(data_new)} samples.")
cols_to_use = data_new.columns.difference(data.columns)

col_on = 'path'
# if 'id' in data.columns and 'id' in data_new.columns:
col_on = "path"
# if 'id' in data.columns and 'id' in data_new.columns:
# col_on = 'id'
cols_to_use = cols_to_use.insert(0, col_on)
data = pd.merge(data, data_new[cols_to_use], on=col_on, how="inner")
Expand Down Expand Up @@ -527,7 +527,7 @@ def main(args):
data = data[data["num_frames"] <= args.fmax]
if args.fpsmax is not None:
assert "fps" in data.columns
data = data[data["fps"] <= args.fpsmax]
data = data[(data["fps"] <= args.fpsmax) | np.isnan(data["fps"])]
if args.hwmax is not None:
if "resolution" not in data.columns:
height = data["height"]
Expand Down Expand Up @@ -590,7 +590,7 @@ def parse_args():
# path processing
parser.add_argument("--relpath", type=str, default=None, help="modify the path to relative path by root given")
parser.add_argument("--abspath", type=str, default=None, help="modify the path to absolute path by root given")
parser.add_argument("--path-to-id", action='store_true', help="add id based on path")
parser.add_argument("--path-to-id", action="store_true", help="add id based on path")

# caption filtering
parser.add_argument(
Expand Down

0 comments on commit ad32081

Please sign in to comment.