Closed guoguangchao closed 5 years ago
Probably generating the prior box + CUDNN optimising for different sized convolutions.
thanks, But I think generating the prior box for each picture should be independent. For images of the same size, each picture should take the same amount of time whether it is the first time or not.
The slowest part will be the CUDNN optimization. Every time it gets a new input size, it calculates the optimal instructions at run time. You can disable this feature by setting torch.backends.cudnn.benchmark = False
See: https://github.com/biubug6/Pytorch_Retinaface/blob/master/detect.py#L73
Okay, thanks for your answer.
I've seen a problem of speed in the issue #1 which is closed now, i found that sometimes the speed is very slow, so i test it, in the detect.py:
i add a line before # testing begin
test_dataset = ['./test_image/0_Parade_marchingband_1_465.jpg', \ './test_image/0_Parade_Parade_0_43.jpg', \ './test_image/1_Handshaking_Handshaking_1_94.jpg', \ './test_image/1_Handshaking_Handshaking_1_158.jpg', \ './test_image/1.jpg', './test_image/2.jpg', './test_image/3.jpg']
The first four pictures are from wider_val, They are all of different sizes, The last three pictures are the same size downloaded from internet. the test_dataset list have 7 images and 5 different sizes
then i run python detect.py , i got the result:
net forward time: 1.5058 net forward time: 1.5821 net forward time: 2.2512 net forward time: 1.5150 net forward time: 2.6007 net forward time: 0.0072 net forward time: 0.0059 net forward time: 0.0061
i found that the first five times were very slow.
so, Is Retinaface particularly slow to see a new image size for the first time? and where is the main time spent? thanks