Skip to content

Commit

Permalink
Fix image list mismatch (#1579)
Browse files Browse the repository at this point in the history
Co-authored-by: Miro <[email protected]>
  • Loading branch information
pgmpablo157321 and mrmhodak authored Jan 26, 2024
1 parent 27ef43a commit 9b8006f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions text_to_image/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ def save_images(self, ids, ds):
for id in ids:
caption = ds.get_caption(id)
generated = Image.fromarray(self.results[idx[id]])
image_path_tmp = f"images/{self.content_ids[id]}.png"
image_path_tmp = f"images/{self.content_ids[idx[id]]}.png"
generated.save(image_path_tmp)
info.append((self.content_ids[id], caption))
info.append((self.content_ids[idx[id]], caption))
with open("images/captions.txt", "w+") as f:
for id, caption in info:
f.write(f"{id} {caption}\n")
Expand Down
2 changes: 2 additions & 0 deletions tools/submission/submission_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1785,6 +1785,8 @@ def check_extra_files(path, target_files):
if target_file not in files:
check_pass = False
missing_files.append(f"{os.path.join(path, dir, target_file)}.png")
if "captions" not in files:
missing_files.append(f"{os.path.join(path, dir, 'captions.txt')}")
return check_pass, missing_files


Expand Down

0 comments on commit 9b8006f

Please sign in to comment.