From 5fbf612d8d930a1ca1b768ac7b6be3bb2d5c3701 Mon Sep 17 00:00:00 2001 From: lijianshe02 Date: Wed, 14 Oct 2020 11:17:40 +0000 Subject: [PATCH] refine psgan code according tho the reviewer's comment --- ppgan/faceutils/mask/model.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/ppgan/faceutils/mask/model.py b/ppgan/faceutils/mask/model.py index 4cd665c..d74c9cc 100644 --- a/ppgan/faceutils/mask/model.py +++ b/ppgan/faceutils/mask/model.py @@ -190,25 +190,3 @@ class BiSeNet(paddle.nn.Layer): feat_out16 = F.interpolate(feat_out16, size=(H, W)) feat_out32 = F.interpolate(feat_out32, size=(H, W)) return feat_out, feat_out16, feat_out32 - - -if __name__ == "__main__": - import pickle - paddle.disable_static() - net = BiSeNet(19) - param, _ = paddle.load('./resnet.pdparams') - net.set_dict(param) - net.eval() - #print(net.state_dict().keys()) - #np.random.seed(2) - #x = np.random.randn(16,3,640,480).astype(np.float32) - with open('./x.pickle', 'rb') as f: - x = pickle.load(f) - in_ten = paddle.to_tensor(x) - out, out16, out32 = net(in_ten) - print(out.numpy().sum()) - with open('./out.pickle', 'wb') as f: - pickle.dump(out.numpy(), f) - print(out.shape) - print(out16.shape) - print(out32.shape) -- GitLab