Skip to content

Commit

Permalink
Compute aspect ratios in log-space
Browse files Browse the repository at this point in the history
  • Loading branch information
catboxanon committed Oct 30, 2024
1 parent e070bd9 commit a5ed288
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/train_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def select_bucket(self, image_width, image_height):
if reso in self.predefined_resos_set:
pass
else:
ar_errors = self.predefined_aspect_ratios - aspect_ratio
ar_errors = np.log(self.predefined_aspect_ratios) - np.log(aspect_ratio)
predefined_bucket_id = np.abs(ar_errors).argmin() # 当該解像度以外でaspect ratio errorが最も少ないもの
reso = self.predefined_resos[predefined_bucket_id]

Expand Down

0 comments on commit a5ed288

Please sign in to comment.