From 55988a651ca2c0369186bcbd2700b813a178460b Mon Sep 17 00:00:00 2001 From: chenjian Date: Tue, 8 Mar 2022 17:42:29 +0800 Subject: [PATCH] fix according to review --- modules/image/image_processing/prnet/api.py | 13 +++++++++++++ .../image/image_processing/prnet/predictor.py | 13 +++++++++++++ modules/image/image_processing/prnet/util.py | 13 +++++++++++++ .../image_processing/prnet/utils/cv_plot.py | 15 ++++++++++++++- .../prnet/utils/estimate_pose.py | 19 ++++++++++++++++++- .../prnet/utils/render_app.py | 16 +++++++++++++++- .../prnet/utils/rotate_vertices.py | 13 +++++++++++++ .../image_processing/prnet/utils/write.py | 16 +++++++++++++++- 8 files changed, 114 insertions(+), 4 deletions(-) diff --git a/modules/image/image_processing/prnet/api.py b/modules/image/image_processing/prnet/api.py index 60f91cf4..2593a4c4 100644 --- a/modules/image/image_processing/prnet/api.py +++ b/modules/image/image_processing/prnet/api.py @@ -1,3 +1,16 @@ +# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. import os from time import time diff --git a/modules/image/image_processing/prnet/predictor.py b/modules/image/image_processing/prnet/predictor.py index 6ecad2f9..f4447920 100644 --- a/modules/image/image_processing/prnet/predictor.py +++ b/modules/image/image_processing/prnet/predictor.py @@ -1,3 +1,16 @@ +# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. import numpy as np import paddle diff --git a/modules/image/image_processing/prnet/util.py b/modules/image/image_processing/prnet/util.py index 92719947..11b9ee3b 100644 --- a/modules/image/image_processing/prnet/util.py +++ b/modules/image/image_processing/prnet/util.py @@ -1,3 +1,16 @@ +# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. import base64 import cv2 diff --git a/modules/image/image_processing/prnet/utils/cv_plot.py b/modules/image/image_processing/prnet/utils/cv_plot.py index e4f19f51..a40efaa5 100644 --- a/modules/image/image_processing/prnet/utils/cv_plot.py +++ b/modules/image/image_processing/prnet/utils/cv_plot.py @@ -1,5 +1,18 @@ -import numpy as np +# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. import cv2 +import numpy as np end_list = np.array([17, 22, 27, 42, 48, 31, 36, 68], dtype=np.int32) - 1 diff --git a/modules/image/image_processing/prnet/utils/estimate_pose.py b/modules/image/image_processing/prnet/utils/estimate_pose.py index 34be417f..ec9986df 100644 --- a/modules/image/image_processing/prnet/utils/estimate_pose.py +++ b/modules/image/image_processing/prnet/utils/estimate_pose.py @@ -1,5 +1,22 @@ +# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from math import asin +from math import atan2 +from math import cos +from math import sin + import numpy as np -from math import cos, sin, atan2, asin def isRotationMatrix(R): diff --git a/modules/image/image_processing/prnet/utils/render_app.py b/modules/image/image_processing/prnet/utils/render_app.py index a24c959a..50a15f44 100644 --- a/modules/image/image_processing/prnet/utils/render_app.py +++ b/modules/image/image_processing/prnet/utils/render_app.py @@ -1,6 +1,20 @@ +# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. import numpy as np -from utils.render import vis_of_vertices, render_texture from scipy import ndimage +from utils.render import render_texture +from utils.render import vis_of_vertices def get_visibility(vertices, triangles, h, w): diff --git a/modules/image/image_processing/prnet/utils/rotate_vertices.py b/modules/image/image_processing/prnet/utils/rotate_vertices.py index daf95346..b96c8c3c 100644 --- a/modules/image/image_processing/prnet/utils/rotate_vertices.py +++ b/modules/image/image_processing/prnet/utils/rotate_vertices.py @@ -1,3 +1,16 @@ +# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. import numpy as np diff --git a/modules/image/image_processing/prnet/utils/write.py b/modules/image/image_processing/prnet/utils/write.py index 7502f2de..67274f08 100644 --- a/modules/image/image_processing/prnet/utils/write.py +++ b/modules/image/image_processing/prnet/utils/write.py @@ -1,6 +1,20 @@ +# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import os + import numpy as np from skimage.io import imsave -import os def write_asc(path, vertices): -- GitLab