Skip to content

Commit

Permalink
Support keeping image ratio in the multi-scale training of YOLOX (ope…
Browse files Browse the repository at this point in the history
…n-mmlab#6732)

* Support keeping ratio in the multi-scale training of YOLOX

* fix typos

* fix typos
  • Loading branch information
GT9505 authored and ZwwWayne committed Jul 18, 2022
1 parent 274452b commit 21a80ef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mmdet/models/detectors/yolox.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ def _random_resize(self):

if self.rank == 0:
size = random.randint(*self._random_size_range)
size = (self._size_multiplier * size, self._size_multiplier * size)
aspect_ratio = float(
self._default_input_size[1]) / self._default_input_size[0]
size = (self._size_multiplier * size,
self._size_multiplier * int(aspect_ratio * size))
tensor[0] = size[0]
tensor[1] = size[1]

Expand Down

0 comments on commit 21a80ef

Please sign in to comment.