cleardusk / 3DDFA_V2

The official PyTorch implementation of Towards Fast, Accurate and Stable 3D Dense Face Alignment, ECCV 2020.
MIT License
2.92k stars 515 forks source link

Project dependencies may have API risk issues #140

Open PyDeps opened 2 years ago

PyDeps commented 2 years ago

Hi, In 3DDFA_V2, inappropriate dependency versioning constraints can cause risks.

Below are the dependencies and version constraints that the project is using

torch
torchvision
matplotlib
numpy
opencv-python
imageio
imageio-ffmpeg
pyyaml
tqdm
argparse
cython
scikit-image
scipy
onnxruntime
gradio

The version constraint == will introduce the risk of dependency conflicts because the scope of dependencies is too strict. The version constraint No Upper Bound and * will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs.

After further analysis, in this project, The version constraint of dependency numpy can be changed to >=1.16.0rc1,<=1.18.5. The version constraint of dependency imageio can be changed to >=1.1-linux32,<=2.19.3. The version constraint of dependency tqdm can be changed to >=4.42.0,<=4.64.0. The version constraint of dependency argparse can be changed to >=1.2.1,<=1.4.0. The version constraint of dependency cython can be changed to >=0.13,<=0.24.1. The version constraint of dependency gradio can be changed to >=0.9.3,<=3.4b3.

The above modification suggestions can reduce the dependency conflicts as much as possible, and introduce the latest version as much as possible without calling Error in the projects.

The invocation of the current project includes all the following methods.

The calling methods from the numpy
distutils.core.Extension
distutils.extension.Extension
c
numpy.linalg.norm
distutils.core.setup
The calling methods from the imageio
imageio.get_reader
imageio.get_writer
The calling methods from the tqdm
itertools.product
tqdm.tqdm
The calling methods from the argparse
argparse.ArgumentParser.parse_args
argparse.ArgumentTypeError
argparse.ArgumentParser
The calling methods from the cython
Cython.Distutils.build_ext.build_extensions
The calling methods from the gradio
gradio.outputs.Image
gradio.inputs.Image
The calling methods from the all methods
calc_pose
self.modules
self.bn1
self._clibs._render
layers.append
x.split
torch.cat.append
bfm.bfm.BFMModel
box_b.box_b.box_b.box_b.unsqueeze
cv2.waitKey
utils.onnx.convert_to_onnx
inp.cuda.cuda
self.avg_pool
utils.io._dump
torch.nn.init.normal_
functions.plot_image
P2sRt
self.branch1x1
torch.nn.init.kaiming_normal_
alpha_exp.self.bfm.w_exp_base.alpha_shp.self.bfm.w_shp_base.self.bfm.u_base.reshape
self.inception2
self.dw2_1
_tensor_to_cuda
os.makedirs
xp.view.size
map
scipy.io.loadmat
x.cpu.numpy
_to_tensor.view
C.copy.astype
self.MobileNet.super.__init__
FaceBoxes.utils.timer.Timer
u.reshape.reshape
o.view
self.MobileNetV3.super.__init__
numpy.round
self.ResNet.super.__init__
gradio.Interface
self.features.append
self.dw6
numpy.ascontiguousarray
subprocess.call
img.copy
ctypes.CDLL
run_cmd
self.relu
f
y.self.fc.view.expand_as
process_uv
vertices.max
utils.functions.parse_roi_box_from_bbox
trans_dim.param.reshape.reshape
self.mean.tensor.sub_.div_
matplotlib.pyplot.subplots_adjust
face_boxes
utils.functions.draw_landmarks
box_b.size
args.video_fp.split.replace
conv3x3
utils.tddfa_util.load_model
matplotlib.pyplot.imshow
x.c.permute.contiguous
utils.io._load.get
self.relu2
matplotlib.pyplot.figure
torch.cat.size
self.conv4_1
torch.nn.BatchNorm2d
_norm
model.cuda.cuda
torch.load.keys
format
os.chdir
imageio.get_writer.append_data
best_prior_idx_filter.squeeze_
Hsigmoid
argparse.ArgumentParser.add_argument
torch.index_select
scores.size
os.path.join
kvs.get.replace
self.dw5_6
boxes.cpu.numpy
model.state_dict.keys
utils.tddfa_util.NormalizeGjz
cv2.resize
kvs.get.models.getattr
self.dw2_2
sys.path.append
type
FaceBoxes
scores.size.torch.Tensor.fill_
tri.T._to_ctype.astype
self.dw5_3
get_colors
self.net.eval
examples.article.description.title.gr.outputs.Image.gr.inputs.Image.inference.gr.Interface.launch
TDDFA.TDDFA
max
utils.nms_wrapper.nms
set
trans_dim.param.reshape
functions.calc_hypotenuse
tddfa_util._to_ctype
Cython.Distutils.build_ext.build_extensions
shape_dim.trans_dim.param.reshape
param.reshape
os.path.split
img.self.transform.unsqueeze
conv_1x1_bn
self.transform
torch.log
torch.nn.Linear
utils.functions.load_model.eval
self.Inception.super.__init__
TDDFA.TDDFA.recon_vers
numpy.floor
conv_bn
numpy.hstack
FaceBoxes.FaceBoxes
tqdm.tqdm
load_uv_coords.copy
m.bias.data.zero_
numpy.where
box_a.size
self.MobileBottleneck.super.__init__
conf.squeeze.data.cpu.numpy
numpy.minimum
cv2.imwrite
math.ceil
self.inception1
kvs.get
_get_suffix
utils.functions.load_model
bfm.BFMModel
self.dw3_1
torch.nn.functional.relu
cv2.imshow
param.flatten.astype
bfm_onnx_fp.replace
numpy.int32.reshape
k.replace.replace
numpy.float32.img.astype.transpose.astype
x.numpy
y.self.fc.view
tuple
torch.cuda.current_device
onnx_path.replace
matplotlib.pyplot.savefig
viz_bbox
img_ori.copy
torch.nn.Softmax
header_temp.format
matrix2angle
BFMModel_ONNX
x.startswith
utils.prior_box.PriorBox
param_lst.append
argparse.ArgumentTypeError
path.split
numpy.std
BFMModel_ONNX.eval
utils.timer.Timer.tic
self.conv2
ord
t3d.reshape
utils.render.render
mode.lower
self.layer2
os.path.exists
xp.view.view
numpy.float32.point_3d.np.array.reshape
getattr
Sim3DR_Cython.rasterize
_load
yaml.load
numpy.cross
self.fc.view
torch.cat
BasicConv2d
self.PriorBox.super.__init__
self.net
conv_layer
utils.serialization.ser_to_obj
FaceBoxes.utils.timer.Timer.tic
box_a.unsqueeze
imageio.get_writer.close
pic.transpose
remove_prefix
torch.randn
alpha_exp.self.bfm.w_exp.alpha_shp.self.bfm.w_shp.self.bfm.u.reshape
utils.timer.Timer.toc
box_b.box_b.box_b.box_b.unsqueeze.expand_as
torch.cat.new
torch.cat.view
torch.nn.init.xavier_normal_
x.l.permute
torch.min
load_uv_coords
vertices.copy
w.shape.w.view.contiguous.permute
self.BasicConv2d.super.__init__
numpy.repeat
pickle.load
torch.nn.PReLU
convert_bfm_to_onnx
time.time
x.mean.mean
box_a.box_a.box_a.box_a.unsqueeze
i.u.min
sys.exit
param.squeeze.cpu.numpy
gradio.inputs.Image
super
self.model.eval
self.conv_param
param.squeeze.cpu.numpy.flatten
jaccard.max
gradio.outputs.Image
x.np.floor.astype
self.conv3_1
math.cos
Sim3DR.RenderPipeline
ValueError
pretrained_state_dict.keys
self.conv4_2
imageio.get_writer
self.conv3_2
state_dict.items
self.keypoints.self.u.reshape
Sim3DR.get_normal
v.lower
torch.hub.download_url_to_file
utils.serialization.ser_to_ply
storage.cuda
arr.copy
numpy.array
self.dw5_4
math.atan2
plot_close
torch.nn.init.ones_
self.branch1x1_2
self.branch3x3_reduce_2
min
collections.deque
x.self.avg_pool.view
utils.tddfa_util.load_model.eval
anchors.torch.Tensor.view
sys.path.insert
self.downsample
range
models.faceboxes.FaceBoxesNet
timeit.repeat
utils.functions.crop_img
nlin_layer
cv2.circle
conf.squeeze.data.cpu
os.getcwd
MobileBottleneck
matplotlib.pyplot.axis
x.data.max
argparse.ArgumentParser
abs
self.relu1
plot_pose_box
args.video_fp.split
block
FaceBoxes.FaceBoxes_ONNX.FaceBoxes_ONNX
utils.timer.Timer
FaceBoxes.utils.timer.Timer.toc
torch.nn.Sequential
c
onnxruntime.InferenceSession
convert_type
param.squeeze.cpu.numpy.flatten.astype.squeeze
SELayer
bfm.get.astype
best_truth_idx.squeeze_
best_prior_idx.squeeze_
argparse.ArgumentParser.parse_args
torch.onnx.export
IoU.le
utils.pncc.pncc
self.w.matmul
torch.nn.ReLU
FaceBoxes_ONNX
param.flatten.astype.flatten
self.softmax
torchvision.transforms.Compose
torch.exp
os.path.realpath
img_.copy
model.load_state_dict
os.path.dirname
numpy.load
numpy.get_include
Sim3DR.rasterize
m.bias.data.fill_
colors.astype.astype
torch.max
bfm_fp._load.get
torch.mul
numpy.int32
ResNet
self.branch3x3_3
TrianglesMeshRender
collections.deque.append
round
box_a.box_a.box_a.box_a.unsqueeze.expand_as
check_keys
math.sqrt
scores.size.torch.Tensor.fill_.long
model.state_dict
args.img_fp.split.replace
self.branch3x3
x.cpu
keep.append
numpy.sum
numpy.zeros_like
encode
torch.nn.functional.avg_pool2d
self.features.mean
o.size
main
self.bn
distutils.extension.Extension
k.replace
self._make_layer
numpy.maximum
self.BFMModel_ONNX.super.__init__
u.view.transpose
distutils.core.Extension
utils.uv.uv_tex
matplotlib.pyplot.show
utils.tddfa_util._to_ctype
IoU.le.size
utils.pose.viz_pose
param.squeeze.cpu
scipy.io.loadmat.copy
self.bn2
self.Identity.super.__init__
torch.set_grad_enabled
tensor.sub_
self.avgpool
self.FaceBoxesNet.super.__init__
jaccard
wfp.replace
collections.deque.popleft
alpha.self.w.matmul.squeeze
numpy.min
self.multibox
self.bfm_session.run
open
_to_ctype
nms.cpu_nms.cpu_nms
utils.functions.parse_roi_box_from_landmark
ver.np.round.astype
numpy.hstack.dot
os.path.abspath
self.layer3
self.BasicBlock.super.__init__
self.SEModule.super.__init__
torch.nn.AdaptiveAvgPool2d
tddfa
self.dw3_2
self.dw5_1
self.features.size
box.np.round.astype
numpy.mean
fp._load.torch.from_numpy.cuda
remove_prefix.keys
_to_tensor
intersect
numpy.newaxis.scores.boxes.np.hstack.astype
frame_bgr.copy
x.c.permute
rb.lt.all
x.l.permute.contiguous
numpy.float32.img.astype.transpose
utils.functions.get_suffix
list
torch.nn.init.zeros_
os.path.isfile
distutils.core.setup
loc.data.squeeze
conf.squeeze
zip
torch.nn.Conv2d
img.torch.from_numpy.unsqueeze
list.append
best_prior_idx.size
utils.tddfa_util.similar_transform
kwargs.get
args.img_fp.split
utils.prior_box.PriorBox.forward
self.dw4_1
utils.functions.plot_image
tddfa.recon_vers.copy
imageio.get_reader.get_meta_data
make_divisible
ver_lst.append
Hswish
self.dw4_2
self.bn_sep
m.weight.data.normal_
TDDFA_ONNX.TDDFA_ONNX
numpy.ctypeslib.as_ctypes
build_camera_box.append
alpha_exp.self.w_exp_base.alpha_shp.self.w_shp_base.self.u_base.reshape
torch.clamp.resize_as_
self.dw5_2
numpy.zeros
add_path
det_bboxes.append
i.u.max
utils.depth.depth
conf.squeeze.data.cpu.numpy.argsort
shape_dim.trans_dim.trans_dim.param.reshape
Sim3DR_Cython.get_normal
imageio.get_reader
torch.clamp
MobileNet
self.model
norm_vertices
cv2.putText
render_app
numpy.clip
numpy.get_numpy_include
box_a.unsqueeze.expand
CRelu
numpy.linalg.norm
numpy.concatenate
param.squeeze.cpu.numpy.flatten.astype
torch.nn.functional.max_pool2d
len
cv2.rectangle
self.fc.size
anchors.torch.Tensor.view.clamp_
numpy.prod
get_colors.copy
math.asin
self.inception3
roi_box_lst.append
self.branch3x3_2
onnx.convert_to_onnx
int
scores.argsort
build_camera_box
IoU.le.numel
cv2.addWeighted
self.tri.T._to_ctype.astype
print
self.CRelu.super.__init__
numpy.float32
f.write
cv2.polylines
numpy.sqrt
utils.box_utils.decode
res_lst.append
self.session.run
Inception
box_b.unsqueeze
scores.sort
torch.nn.functional.relu6
self.conv_dw
filename.rfind
box_b.unsqueeze.expand
utils.tddfa_util.ToTensorGjz
self.bn_dw
matplotlib.pyplot.plot
MobileNetV3
norm_layer
self.Hsigmoid.super.__init__
self.layer1
vertices.min
utils.tddfa_util._parse_param
point_form
bilinear_interpolate
numpy.ones
Exception
self.dw5_5
torch.load
make_abs_path
best_prior_overlap.squeeze_
self.features
functions.get_suffix
torch.sum
self.conv1
enumerate
x.cuda
cv2.line
boxes.cpu.numpy.cpu
self.conv
pickle.dump
best_truth_overlap.index_fill_
y.np.floor.astype
l
isinstance
self.conv_sep
self.DepthWiseBlock.super.__init__
torch.Tensor
bfm.bfm_onnx.convert_bfm_to_onnx
fn.replace
numpy.ceil
utils.io._load
cv2.imread
w.shape.w.view.contiguous
torch.from_numpy.float
numpy.save
utils.functions.cv_draw_landmark
m.weight.data.fill_
best_truth_overlap.squeeze_
self._initialize_weights
self.Hswish.super.__init__
torch.from_numpy
self.fc
itertools.product
cv2.imread.transpose
torch.cat.numel
self.branch3x3_reduce

@developer Could please help me check this issue? May I pull a request to fix it? Thank you very much.

forever208 commented 1 year ago

requirements.txt has a compatibility issue now if I directly install by pip install -r requirements.txt

the below versions work in my ubuntu 20.04:

numpy~=1.21.6
torch~=1.13.1
opencv-python~=4.7.0.68
scipy~=1.7.3
matplotlib~=3.5.3
cython~=0.29.33
pyyaml~=6.0
torchvision~=0.14.1
onnxruntime~=1.13.1
imageio~=2.25.0
tqdm~=4.64.1
imageio-ffmpeg~=0.4.8