diff --git a/modules/image/image_processing/prnet/api.py b/modules/image/image_processing/prnet/api.py index 60f91cf40b1fb7b4171f1a10b06c02e169292ce3..2593a4c4ef9d1ff9cce2eb5d6f5053fab052c628 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 6ecad2f969073299e354a6cf78380413d088ef79..f44479201810e45b2a33de960b1ab90c2674b6c2 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 927199476050e27e036078902c21bf92d2b475da..11b9ee3be3cb437a794cb357da38bb7bbb1a2d6d 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 e4f19f512541f829054dba36ec38915761f69003..a40efaa50ca043b5c62e7e33bf6f48edf2a53d1e 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 34be417f48bd995efdd0e942e9e087349e9856e3..ec9986df03a63c1b90ac027d7d53abeae22aa74b 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 a24c959ac1c8e35b64c7fcf0ea55053ff143cc34..50a15f449733580f3942f7f1923818e98059486a 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 daf953469b81729edfbc88c71ef4625b75397c4b..b96c8c3cc3590ef2b6dff4dcd2eb9e065f4cde4d 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 7502f2def7ddc213c6a7aa75972ed8e756e4d0d2..67274f0843a118946572f2d6672b2f0ad1b631e9 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):