Commit 8648d571 authored by Yuxin Wu's avatar Yuxin Wu

correct rounding in imagenet augmentor

parent 9bf59445
...@@ -33,8 +33,8 @@ class GoogleNetResize(imgaug.ImageAugmentor): ...@@ -33,8 +33,8 @@ class GoogleNetResize(imgaug.ImageAugmentor):
for _ in range(10): for _ in range(10):
targetArea = self.rng.uniform(0.08, 1.0) * area targetArea = self.rng.uniform(0.08, 1.0) * area
aspectR = self.rng.uniform(0.75, 1.333) aspectR = self.rng.uniform(0.75, 1.333)
ww = int(np.sqrt(targetArea * aspectR)) ww = int(np.sqrt(targetArea * aspectR) + 0.5)
hh = int(np.sqrt(targetArea / aspectR)) hh = int(np.sqrt(targetArea / aspectR) + 0.5)
if self.rng.uniform() < 0.5: if self.rng.uniform() < 0.5:
ww, hh = hh, ww ww, hh = hh, ww
if hh <= h and ww <= w: if hh <= h and ww <= w:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment