Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/open-mmlab/mmrotate into cfg_md
Browse files Browse the repository at this point in the history
  • Loading branch information
zytx121 committed Mar 3, 2022
2 parents 3825551 + dd40984 commit b849ed2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ jobs:
- name: Build and install
run: pip install -e .
- name: Run unittests
run: coverage run --branch --source mmrotate -m pytest tests -sv
run: coverage run --branch --source mmrotate -m pytest tests
- name: Generate coverage report
run: |
coverage xml
Expand Down
Binary file added demo/dota_demo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed demo/dota_demo.png
Binary file not shown.
4 changes: 2 additions & 2 deletions mmrotate/datasets/dota.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import zipfile
from collections import defaultdict
from functools import partial
from multiprocessing import Pool
from multiprocessing import get_context

import mmcv
import numpy as np
Expand Down Expand Up @@ -380,7 +380,7 @@ def eval_map(det_results,
area_ranges = ([(rg[0]**2, rg[1]**2) for rg in scale_ranges]
if scale_ranges is not None else None)

pool = Pool(nproc)
pool = get_context('spawn').Pool(nproc)
eval_results = []
for i in range(num_classes):
# get gt and det bboxes of this class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,21 @@ def forward(self, feats, rois, roi_scale_factor=None):
Returns:
torch.Tensor: Scaled RoI features.
"""
out_size = self.roi_layers[0].out_size
if isinstance(self.roi_layers[0], ops.RiRoIAlignRotated):
out_size = nn.modules.utils._pair(self.roi_layers[0].out_size)
else:
out_size = self.roi_layers[0].output_size
num_levels = len(feats)
expand_dims = (-1, self.out_channels * out_size * out_size)
expand_dims = (-1, self.out_channels * out_size[0] * out_size[1])
if torch.onnx.is_in_onnx_export():
# Work around to export mask-rcnn to onnx
roi_feats = rois[:, :1].clone().detach()
roi_feats = roi_feats.expand(*expand_dims)
roi_feats = roi_feats.reshape(-1, self.out_channels, out_size,
out_size)
roi_feats = roi_feats.reshape(-1, self.out_channels, *out_size)
roi_feats = roi_feats * 0
else:
roi_feats = feats[0].new_zeros(
rois.size(0), self.out_channels, out_size, out_size)
rois.size(0), self.out_channels, *out_size)
# TODO: remove this when parrots supports
if torch.__version__ == 'parrots':
roi_feats.requires_grad = True
Expand Down

0 comments on commit b849ed2

Please sign in to comment.