Skip to content

Commit

Permalink
rename np.int and np.int32 as int
Browse files Browse the repository at this point in the history
  • Loading branch information
kennymckormick committed Apr 19, 2023
1 parent 9e43b46 commit e36e39c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pyskl/datasets/pipelines/augmentations.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@ def get_crop_bbox(img_shape,
np.log(min_ar), np.log(max_ar), size=max_attempts))
target_areas = np.random.uniform(*area_range, size=max_attempts) * area
candidate_crop_w = np.round(np.sqrt(target_areas *
aspect_ratios)).astype(np.int32)
aspect_ratios)).astype(int)
candidate_crop_h = np.round(np.sqrt(target_areas /
aspect_ratios)).astype(np.int32)
aspect_ratios)).astype(int)

for i in range(max_attempts):
crop_w = candidate_crop_w[i]
Expand Down
2 changes: 1 addition & 1 deletion pyskl/datasets/pipelines/multi_modality.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __call__(self, results):
else:
inds = self._get_train_clips(num_frames, clip_len)
inds = np.mod(inds, num_frames)
results[f'{modality}_inds'] = inds.astype(np.int)
results[f'{modality}_inds'] = inds.astype(int)
modalities.append(modality)
results['clip_len'] = self.clip_len
results['frame_interval'] = None
Expand Down
16 changes: 8 additions & 8 deletions pyskl/datasets/pipelines/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ def __call__(self, results):
transitional[i] = transitional[i - 1] = True
if num_persons[i] != num_persons[i + 1]:
transitional[i] = transitional[i + 1] = True
inds_int = inds.astype(np.int)
inds_int = inds.astype(int)
coeff = np.array([transitional[i] for i in inds_int])
inds = (coeff * inds_int + (1 - coeff) * inds).astype(np.float32)

results['frame_inds'] = inds.astype(np.int)
results['frame_inds'] = inds.astype(int)
results['clip_len'] = self.clip_len
results['frame_interval'] = None
results['num_clips'] = self.num_clips
Expand Down Expand Up @@ -354,9 +354,9 @@ def _get_train_clips(self, num_frames):
if num_frames > ori_clip_len - 1:
base_offsets = np.arange(self.num_clips) * avg_interval
clip_offsets = (base_offsets + np.random.uniform(
0, avg_interval, self.num_clips)).astype(np.int)
0, avg_interval, self.num_clips)).astype(int)
else:
clip_offsets = np.zeros((self.num_clips, ), dtype=np.int)
clip_offsets = np.zeros((self.num_clips, ), dtype=int)
else:
avg_interval = (num_frames - ori_clip_len + 1) // self.num_clips

Expand All @@ -372,7 +372,7 @@ def _get_train_clips(self, num_frames):
ratio = (num_frames - ori_clip_len + 1.0) / self.num_clips
clip_offsets = np.around(np.arange(self.num_clips) * ratio)
else:
clip_offsets = np.zeros((self.num_clips, ), dtype=np.int)
clip_offsets = np.zeros((self.num_clips, ), dtype=int)

return clip_offsets

Expand All @@ -394,11 +394,11 @@ def _get_test_clips(self, num_frames):
avg_interval = (num_frames - ori_clip_len + 1) / float(self.num_clips)
if num_frames > ori_clip_len - 1:
base_offsets = np.arange(self.num_clips) * avg_interval
clip_offsets = (base_offsets + avg_interval / 2.0).astype(np.int)
clip_offsets = (base_offsets + avg_interval / 2.0).astype(int)
if self.twice_sample:
clip_offsets = np.concatenate([clip_offsets, base_offsets])
else:
clip_offsets = np.zeros((self.num_clips, ), dtype=np.int)
clip_offsets = np.zeros((self.num_clips, ), dtype=int)
return clip_offsets

def _sample_clips(self, num_frames, test_mode=False):
Expand Down Expand Up @@ -450,7 +450,7 @@ def __call__(self, results):

start_index = results['start_index']
frame_inds = np.concatenate(frame_inds) + start_index
results['frame_inds'] = frame_inds.astype(np.int)
results['frame_inds'] = frame_inds.astype(int)
results['clip_len'] = self.clip_len
results['frame_interval'] = self.frame_interval
results['num_clips'] = self.num_clips
Expand Down

0 comments on commit e36e39c

Please sign in to comment.