Skip to content

Commit 2f25bce

Browse files
committed
update np.int32 and np.float32
1 parent 2a5f297 commit 2f25bce

File tree

61 files changed

+190
-190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+190
-190
lines changed

alignment/coordinate_reg/image_infer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
color = (200, 160, 75)
1616
for face in faces:
1717
lmk = face.landmark_2d_106
18-
lmk = np.round(lmk).astype(np.int)
18+
lmk = np.round(lmk).astype(np.int32)
1919
for i in range(lmk.shape[0]):
2020
p = tuple(lmk[i])
2121
cv2.circle(tim, p, 1, color, 1, cv2.LINE_AA)

alignment/heatmap/metric.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def cal_nme(self, label, pred_label):
5151
ind_gt = np.array(ind_gt)
5252
else:
5353
ind_gt = label[b][p]
54-
#ind_gt = ind_gt.astype(np.int)
54+
#ind_gt = ind_gt.astype(np.int32)
5555
#print(ind_gt)
5656
heatmap_pred = pred_label[b][p]
5757
heatmap_pred = cv2.resize(

alignment/synthetics/datasets/augs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def apply(self, image, border_size_limit, **params):
2424
border_size[2] *= image.shape[1]
2525
border_size[1] *= image.shape[0]
2626
border_size[3] *= image.shape[0]
27-
border_size = border_size.astype(np.int)
27+
border_size = border_size.astype(np.int32)
2828
image[:,:border_size[0],:] = self.fill_value
2929
image[:border_size[1],:,:] = self.fill_value
3030
image[:,-border_size[2]:,:] = self.fill_value

alignment/synthetics/test_synthetics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@
8585
outf.write(' ')
8686
outf.write(' '.join(["%.5f"%x for x in kps.flatten()]))
8787
outf.write("\n")
88-
box = bbox.astype(np.int)
88+
box = bbox.astype(np.int32)
8989
color = (0, 0, 255)
9090
cv2.rectangle(dimg, (box[0], box[1]), (box[2], box[3]), color, 2)
91-
kps = kps.astype(np.int)
91+
kps = kps.astype(np.int32)
9292
#print(landmark.shape)
9393
for l in range(kps.shape[0]):
9494
color = (0, 0, 255)

alignment/synthetics/tools/prepare_synthetics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@
4848
_scale = output_size / (max(w, h)*1.5)
4949
aimg, M = face_align.transform(dimg, center, output_size, _scale, rotate)
5050
pred = face_align.trans_points(pred, M)
51-
#box = bbox.astype(np.int)
51+
#box = bbox.astype(np.int32)
5252
#color = (0, 0, 255)
5353
#cv2.rectangle(dimg, (box[0], box[1]), (box[2], box[3]), color, 2)
5454

55-
#kps = pred.astype(np.int)
55+
#kps = pred.astype(np.int32)
5656
#for l in range(kps.shape[0]):
5757
# color = (0, 0, 255)
5858
# cv2.circle(aimg, (kps[l][0], kps[l][1]), 1, color, 2)

body/human_pose/ambiguity_aware/scripts/eval_lsp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@
9393
else:
9494
color = "darkorange"
9595
cv_color = (89, 141, 252)
96-
x1, y1 = joints_2d[i].astype(np.int)
97-
x2, y2 = joints_2d[j].astype(np.int)
96+
x1, y1 = joints_2d[i].astype(np.int32)
97+
x2, y2 = joints_2d[j].astype(np.int32)
9898

9999
cv2.line(image, (x1, y1), (x2, y2), cv_color, 2)
100100
x1, y1, z1 = joints_3d_pre[i]
101101
x2, y2, z2 = joints_3d_pre[j]
102102
ax.plot([z1, z2], [x1, x2], [-y1, -y2], c=color, linewidth=3)
103103

104-
image = image[::-1, :, ::-1].copy().astype(np.float) / 255.
104+
image = image[::-1, :, ::-1].copy().astype(np.float32) / 255.
105105
r = 0.95
106106
xroot = yroot = zroot = 0.
107107
# radius = max(4, (np.mean(image.shape[:2]) * 0.01).astype(int))

body/human_pose/ambiguity_aware/scripts/inference.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@
103103
else:
104104
color = "darkorange"
105105
cv_color = (89, 141, 252)
106-
x1, y1 = joints_2d[i].astype(np.int)
107-
x2, y2 = joints_2d[j].astype(np.int)
106+
x1, y1 = joints_2d[i].astype(np.int32)
107+
x2, y2 = joints_2d[j].astype(np.int32)
108108

109109
cv2.line(image, (x1, y1), (x2, y2), cv_color, 2)
110110
x1, y1, z1 = joints_3d_pre[i]
111111
x2, y2, z2 = joints_3d_pre[j]
112112
ax.plot([z1, z2], [x1, x2], [-y1, -y2], c=color, linewidth=3)
113113

114-
image = image[::-1, :, ::-1].copy().astype(np.float) / 255.
114+
image = image[::-1, :, ::-1].copy().astype(np.float32) / 255.
115115
r = 0.95
116116
xroot = yroot = zroot = 0.
117117
# radius = max(4, (np.mean(image.shape[:2]) * 0.01).astype(int))

detection/retinaface/rcnn/PY_OP/cascade_refine.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ def assign_anchor_fpn(self,
127127
if gt_boxes.size > 0:
128128
# overlap between the anchors and the gt boxes
129129
# overlaps (ex, gt)
130-
overlaps = bbox_overlaps(anchors.astype(np.float),
131-
gt_boxes.astype(np.float))
130+
overlaps = bbox_overlaps(anchors.astype(np.float32),
131+
gt_boxes.astype(np.float32))
132132
argmax_overlaps = overlaps.argmax(axis=1)
133133
#print('AAA', argmax_overlaps.shape)
134134
max_overlaps = overlaps[np.arange(num_anchors), argmax_overlaps]
@@ -344,13 +344,13 @@ def forward(self, is_train, req, in_data, out_data, aux):
344344
assert anchors_t1.shape[0] == self.ori_anchors.shape[0]
345345

346346
#for i in range(_gt_boxes.shape[0]):
347-
# box = _gt_boxes[i].astype(np.int)
347+
# box = _gt_boxes[i].astype(np.int32)
348348
# print('%d: gt%d'%(self.nbatch, i), box)
349349
# #color = (0,0,255)
350350
# #cv2.rectangle(img, (box[0], box[1]), (box[2], box[3]), color, 2)
351351
#for i in range(anchors_t1.shape[0]):
352-
# box1 = self.ori_anchors[i].astype(np.int)
353-
# box2 = anchors_t1[i].astype(np.int)
352+
# box1 = self.ori_anchors[i].astype(np.int32)
353+
# box2 = anchors_t1[i].astype(np.int32)
354354
# print('%d %d: anchorscompare %d'%(self.nbatch, self.stride, i), box1, box2)
355355
#color = (255,255,0)
356356
#cv2.rectangle(img, (box[0], box[1]), (box[2], box[3]), color, 2)

detection/retinaface/rcnn/core/loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def get_batch(self):
247247
print('DEBUG SHAPE', data['data'].shape,
248248
label['gt_boxes'].shape)
249249

250-
box = label['gt_boxes'].copy()[0][0:4].astype(np.int)
250+
box = label['gt_boxes'].copy()[0][0:4].astype(np.int32)
251251
cv2.rectangle(img, (box[0], box[1]), (box[2], box[3]),
252252
(0, 255, 0), 2)
253253
filename = './debugout/%d.png' % (self._debug_id)

detection/retinaface/rcnn/core/tester.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ def test_proposals(predictor, test_data, imdb, roidb, vis=False):
238238
gt_boxes[:, 1] + 1)
239239
num_pos += gt_boxes.shape[0]
240240

241-
overlaps = bbox_overlaps(boxes.astype(np.float),
242-
gt_boxes.astype(np.float))
241+
overlaps = bbox_overlaps(boxes.astype(np.float32),
242+
gt_boxes.astype(np.float32))
243243
#print(im_info, gt_boxes.shape, boxes.shape, overlaps.shape, file=sys.stderr)
244244

245245
_gt_overlaps = np.zeros((gt_boxes.shape[0]))

0 commit comments

Comments
 (0)