Skip to content

Commit

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

* fix typos

* fix typos
  • Loading branch information
GT9505 authored and ZwwWayne committed Dec 14, 2021
1 parent 0a546d7 commit 07432b0
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 07432b0

Please sign in to comment.