Skip to content

Commit

Permalink
add fpsmax function (hpcaitech#102)
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 14, 2024
1 parent f73f756 commit 03b47fa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/datasets/datautil.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,9 @@ def main(args):
if args.fmax is not None:
assert "num_frames" in data.columns
data = data[data["num_frames"] <= args.fmax]
if args.fpsmax is not None:
assert "fps" in data.columns
data = data[data["fps"] <= args.fpsmax]
if args.hwmax is not None:
if "resolution" not in data.columns:
height = data["height"]
Expand Down Expand Up @@ -618,6 +621,7 @@ def parse_args():
parser.add_argument("--aesmin", type=float, default=None, help="filter the dataset by minimum aes score")
parser.add_argument("--matchmin", type=float, default=None, help="filter the dataset by minimum match score")
parser.add_argument("--flowmin", type=float, default=None, help="filter the dataset by minimum flow score")
parser.add_argument("--fpsmax", type=float, default=None, help="filter the dataset by maximum fps")

return parser.parse_args()

Expand Down Expand Up @@ -682,6 +686,8 @@ def get_output_path(args, input_name):
name += f"_fmin{args.fmin}"
if args.fmax is not None:
name += f"_fmax{args.fmax}"
if args.fpsmax is not None:
name += f"_fpsmax{args.fpsmax}"
if args.hwmax is not None:
name += f"_hwmax{args.hwmax}"
if args.aesmin is not None:
Expand Down

0 comments on commit 03b47fa

Please sign in to comment.