ObjectDetection-OneStageDet icon indicating copy to clipboard operation
ObjectDetection-OneStageDet copied to clipboard

The time consuming of preprocessing?

Open LDoubleZhi opened this issue 6 years ago • 2 comments

lb = vn_data.transform.Letterbox(hyper_params.network_size) it = tf.ToTensor() img_tf = vn_data.transform.Compose([lb, it]) s1 = time.time() data = img_tf(img).cuda() e1 = time.time() data = torch.unsqueeze(data, 0) print('preprocessing per img consume: {}'.format(e1 - s1)) I find it cost 0.02s on K80, and the code in speed.py have not include preprocessing(padding-rescale & .cuda()). how to solve it?

LDoubleZhi avatar Sep 16 '19 02:09 LDoubleZhi

When I am using cv2, the time consuming reduce to 0.007s. But the output = net(data) cost 0.1s. I don't konw why.

LDoubleZhi avatar Sep 16 '19 06:09 LDoubleZhi

In fact, When I am runing the code. sometime the net cost 0.01s, and sometime it cost 0.1s. It's ridiculous. I am using single k80

LDoubleZhi avatar Sep 16 '19 06:09 LDoubleZhi