Skip to content

Commit

Permalink
Merge pull request #77 from Photoroom/ben/hotfix
Browse files Browse the repository at this point in the history
[hotfix] Image size buckets
  • Loading branch information
blefaudeux authored Jan 28, 2025
2 parents bc3a3c0 + 9226c28 commit 804dd94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/transforms.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func buildImageSizeList(defaultImageSize int, downsamplingRatio int, minAspectRa
patchSizeSq := float64(patchSize * patchSize)
var imgSizes []ImageSize

minPatchW := int(math.Ceil(patchSizeSq * minAspectRatio))
maxPatchW := int(math.Floor(patchSizeSq * maxAspectRatio))
minPatchW := int(math.Ceil(math.Sqrt(patchSizeSq * minAspectRatio)))
maxPatchW := int(math.Floor(math.Sqrt(patchSizeSq * maxAspectRatio)))

for patchW := minPatchW; patchW <= maxPatchW; patchW++ { // go over all possible downsampled image widths
patchH := int(math.Floor(patchSizeSq / float64(patchW))) // get max height
Expand Down

0 comments on commit 804dd94

Please sign in to comment.