Skip to content

Commit

Permalink
Merge pull request open-mmlab#1 from open-mmlab/master
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
Gaozhongpai authored Aug 14, 2023
2 parents 865359f + 21aeeb4 commit e3da80b
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 47 deletions.
45 changes: 19 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,20 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: [3.7]
torch: [1.5.0, 1.6.0, 1.7.0, 1.8.0]
torch: [1.5.0, 1.8.0, 1.10.0]
include:
- torch: 1.5.0
torch_version: torch1.5
torchvision: 0.6.0
- torch: 1.6.0
torch_version: torch1.6
torchvision: 0.7.0
- torch: 1.7.0
torch_version: torch1.7
torchvision: 0.8.1
torch_version: 1.5.0
python-version: '3.7'
- torch: 1.8.0
torch_version: torch1.8
torchvision: 0.9.0
torch_version: 1.8.0
python-version: '3.8'
- torch: 1.10.0
torchvision: 0.11.1
torch_version: 1.10.0
python-version: '3.9'

steps:
- uses: actions/checkout@v2
Expand All @@ -54,7 +53,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: pip install pip --upgrade
run: pip install pip numpy --upgrade
- name: Install onnx
run: pip install onnx
- name: Install PyTorch
Expand Down Expand Up @@ -82,21 +81,15 @@ jobs:
image: pytorch/pytorch:1.6.0-cuda10.1-cudnn7-devel
strategy:
matrix:
python-version: [3.7]
torch: [1.5.0, 1.6.0, 1.7.0, 1.8.0]
python-version: [3.8]
torch: [1.5.0, 1.8.0]
include:
- torch: 1.5.0
torch_version: torch1.5
torchvision: 0.6.0
- torch: 1.6.0
torch_version: torch1.6
torchvision: 0.7.0
- torch: 1.7.0
torch_version: torch1.7
torchvision: 0.8.1
torch_version: 1.5.0
- torch: 1.8.0
torch_version: torch1.8
torchvision: 0.9.0
torch_version: 1.8.0

steps:
- uses: actions/checkout@v2
Expand All @@ -114,7 +107,7 @@ jobs:
apt-get clean
rm -rf /var/lib/apt/lists/*
- name: Upgrade pip
run: python -m pip install pip --upgrade
run: python -m pip install pip numpy --upgrade
- name: Install dependencies for compiling onnx when python=3.9
run: python -m pip install protobuf && apt-get install -y libprotobuf-dev protobuf-compiler
if: ${{matrix.python-version == '3.9'}}
Expand Down Expand Up @@ -153,7 +146,7 @@ jobs:
image: pytorch/pytorch:1.9.0-cuda10.2-cudnn7-devel
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
torch: [1.9.0, 1.10.0]
include:
- torch: 1.9.0
Expand All @@ -179,7 +172,7 @@ jobs:
apt-get clean
rm -rf /var/lib/apt/lists/*
- name: Upgrade pip
run: python -m pip install pip --upgrade
run: python -m pip install pip numpy --upgrade
- name: Install dependencies for compiling onnx when python=3.9
run: python -m pip install protobuf && apt-get update && apt-get -y install libprotobuf-dev protobuf-compiler cmake
if: ${{matrix.python-version == '3.9'}}
Expand Down Expand Up @@ -226,7 +219,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install pip --upgrade --user
run: python -m pip install pip numpy --upgrade --user
- name: Install PyTorch
# As a complement to Linux CI, we test on PyTorch LTS version
run: python -m pip install torch==1.8.2+${{ matrix.platform }} torchvision==0.9.2+${{ matrix.platform }} -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
Expand Down Expand Up @@ -254,7 +247,7 @@ jobs:
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
flags: unittests
flags: unittestsstat
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
hooks:
- id: flake8
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.11.5
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-yapf
Expand Down
6 changes: 5 additions & 1 deletion docs/en/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ If the contents here do not cover your issue, please create an issue using the [

| MMPose version | MMCV version |
| :------------: | :-----------------------: |
| master | mmcv-full>=1.3.8, \<1.7.0 |
| master | mmcv-full>=1.3.8, \<1.8.0 |
| 0.29.0 | mmcv-full>=1.3.8, \<1.7.0 |
| 0.28.1 | mmcv-full>=1.3.8, \<1.7.0 |
| 0.28.0 | mmcv-full>=1.3.8, \<1.6.0 |
| 0.27.0 | mmcv-full>=1.3.8, \<1.6.0 |
| 0.26.0 | mmcv-full>=1.3.8, \<1.6.0 |
| 0.25.1 | mmcv-full>=1.3.8, \<1.6.0 |
| 0.25.0 | mmcv-full>=1.3.8, \<1.5.0 |
Expand Down
6 changes: 5 additions & 1 deletion docs/zh_cn/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@

| MMPose 版本 | MMCV 版本 |
| :---------: | :-----------------------: |
| master | mmcv-full>=1.3.8, \<1.7.0 |
| master | mmcv-full>=1.3.8, \<1.8.0 |
| 0.29.0 | mmcv-full>=1.3.8, \<1.7.0 |
| 0.28.1 | mmcv-full>=1.3.8, \<1.7.0 |
| 0.28.0 | mmcv-full>=1.3.8, \<1.6.0 |
| 0.27.0 | mmcv-full>=1.3.8, \<1.6.0 |
| 0.26.0 | mmcv-full>=1.3.8, \<1.6.0 |
| 0.25.1 | mmcv-full>=1.3.8, \<1.6.0 |
| 0.25.0 | mmcv-full>=1.3.8, \<1.5.0 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def _load_files(self):
assert osp.exists(self.gt_pose_db_file), f'gt_pose_db_file ' \
f"{self.gt_pose_db_file} doesn't exist, please check again"
gt = loadmat(self.gt_pose_db_file)
self.gt_pose_db = np.array(np.array(
gt['actor3D'].tolist()).tolist()).squeeze()

self.gt_pose_db = np.array(gt['actor3D'].tolist()).squeeze()

self.num_persons = len(self.gt_pose_db)
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def _get_db(self):
dtype=np.float32)

cnt = 0
person_ids = -np.ones(self.max_persons, dtype=np.int)
person_ids = -np.ones(self.max_persons, dtype=int)
for body in bodies:
if cnt >= self.max_persons:
break
Expand Down
22 changes: 9 additions & 13 deletions mmpose/datasets/pipelines/bottom_up_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ def __init__(self, output_size, num_joints, sigma=-1, use_udp=False):
assert len(output_size) == 2
self.output_size = output_size
else:
self.output_size = np.array([output_size, output_size],
dtype=np.int)
self.output_size = np.array([output_size, output_size], dtype=int)
self.num_joints = num_joints
if sigma < 0:
sigma = self.output_size.prod()**0.5 / 64
Expand Down Expand Up @@ -243,8 +242,7 @@ def __init__(self, output_size, num_joints, radius=4):
assert len(output_size) == 2
self.output_size = output_size
else:
self.output_size = np.array([output_size, output_size],
dtype=np.int)
self.output_size = np.array([output_size, output_size], dtype=int)
self.num_joints = num_joints
assert radius > 0, f'`radius` must be a positive value, ' \
f'but got {radius}'
Expand Down Expand Up @@ -320,8 +318,7 @@ def __init__(self, max_num_people, num_joints, output_size, tag_per_joint):
assert len(output_size) == 2
self.output_size = output_size
else:
self.output_size = np.array([output_size, output_size],
dtype=np.int)
self.output_size = np.array([output_size, output_size], dtype=int)
self.tag_per_joint = tag_per_joint

def __call__(self, joints):
Expand Down Expand Up @@ -371,8 +368,7 @@ def __init__(self, output_size, limb_width, skeleton):
assert len(output_size) == 2
self.output_size = output_size
else:
self.output_size = np.array([output_size, output_size],
dtype=np.int)
self.output_size = np.array([output_size, output_size], dtype=int)
self.limb_width = limb_width
self.skeleton = skeleton

Expand Down Expand Up @@ -527,7 +523,7 @@ def __call__(self, results):
assert len(_output_size) == 2
else:
_output_size = np.array([_output_size, _output_size],
dtype=np.int)
dtype=int)
mask[i] = mask[i][:, ::-1].copy()
joints[i] = joints[i][:, self.flip_index]
joints[i][:, :, 0] = _output_size[0] - joints[i][:, :, 0] - 1
Expand Down Expand Up @@ -1053,13 +1049,13 @@ def __call__(self, results):
results['multi_heatmap'] = heatmap_with_center
results['multi_mask'] = mask[None, :, :]
# pad instance targets for batching
instance_coord = np.zeros((self.max_num_people, 2), dtype=np.int32)
instance_coord = np.zeros((self.max_num_people, 2), dtype=int)
instance_heatmap = np.zeros(
(self.max_num_people, num_keypoints, output_size, output_size),
dtype=np.float32)
instance_mask = np.zeros((self.max_num_people, num_keypoints, 1, 1),
dtype=np.float32)
instance_valid = np.zeros((self.max_num_people), dtype=np.int32)
instance_valid = np.zeros((self.max_num_people), dtype=int)
if len(inst_coords) > 0:
idx_list = list(range(len(inst_coords)))
random.shuffle(idx_list)
Expand Down Expand Up @@ -1156,7 +1152,7 @@ def __call__(self, results):
if input_size.size > 1:
assert len(input_size) == 2
else:
input_size = np.array([input_size, input_size], dtype=np.int)
input_size = np.array([input_size, input_size], dtype=int)
img = results['img']

base_size, center, scale = _get_multi_scale_size(
Expand Down Expand Up @@ -1199,7 +1195,7 @@ def __call__(self, results):
if input_size.size > 1:
assert len(input_size) == 2
else:
input_size = np.array([input_size, input_size], dtype=np.int)
input_size = np.array([input_size, input_size], dtype=int)
test_scale_factor = results['ann_info']['test_scale_factor']
aug_data = []

Expand Down
4 changes: 2 additions & 2 deletions tests/test_models/test_bottom_up_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ def _demo_cid_inputs(input_shape=(1, 3, 512, 512)):
imgs = rng.rand(*input_shape)
multi_heatmap = np.zeros([N, 18, H // 4, W // 4], dtype=np.float32)
multi_mask = np.ones([N, 1, H // 4, W // 4], dtype=np.float32)
instance_coord = np.zeros([N, 30, 2], dtype=np.int64)
instance_coord = np.zeros([N, 30, 2], dtype=int)
instance_heatmap = np.zeros([N, 30, 17, H // 4, W // 4], dtype=np.float32)
instance_mask = np.ones([N, 30, 17, 1, 1], dtype=np.float32)
instance_valid = np.ones([N, 30], dtype=np.int64)
instance_valid = np.ones([N, 30], dtype=int)

img_metas = [{
'image_file':
Expand Down

0 comments on commit e3da80b

Please sign in to comment.