Skip to content

Commit

Permalink
Added an option to pass in sample_ids.txt for SDXL accuracy check
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Nov 7, 2024
1 parent 4c109ea commit 40c1fe0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion text_to_image/tools/accuracy_coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def get_args():
required=False,
help="path to dump 10 stable diffusion xl compliance images",
)
#Do not use for official MLPerf inference submissions as only the default one is valid
parser.add_argument(
"--ids-path", help="Path to 10 caption ids to dump as compliance images", default="os.path.join(os.path.dirname(__file__), 'sample_ids.txt')"
)
parser.add_argument("--device", default="cpu", choices=["gpu", "cpu"])
parser.add_argument(
"--low_memory",
Expand Down Expand Up @@ -97,8 +101,9 @@ def main():
os.makedirs(args.compliance_images_path)
dump_compliance_images = True
compliance_images_idx_list = []
sample_ids_file_path = args.ids_path if args.ids_path else os.path.join(os.path.dirname(__file__), "sample_ids.txt")
with open(
os.path.join(os.path.dirname(__file__), "sample_ids.txt"), "r"
os.path.join(sample_ids_file_path, "r"
) as compliance_id_file:
for line in compliance_id_file:
idx = int(line.strip())
Expand Down

0 comments on commit 40c1fe0

Please sign in to comment.