lhwcv / mlsd_pytorch

Pytorch implementation of "M-LSD: Towards Light-weight and Real-time Line Segment Detection"
Apache License 2.0
190 stars 37 forks source link

performance speed #10

Closed hirokic5 closed 2 years ago

hirokic5 commented 2 years ago

Thanks for your great repository !!!

I ran demo.py, and measured large model performance speed, it resulted in almost 12FPS on RTX 2080Ti. Codes likes below:

import time
torch.cuda.synchronize()
start=time.time()
img = cv2.imread(img_fn)
img = cv2.resize(img, (512, 512))

img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
lines = pred_lines(img, model, [512, 512], 0.1, 20)
img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)

for l in lines:
    cv2.line(img, (int(l[0]), int(l[1])), (int(l[2]), int(l[3])), (0,200,200), 1,16)

torch.cuda.synchronize()
time.time()-start
# 0.0828

So, in your environment, how fast does large model work ?? (and I'd like to know your GPU envirnoment ).

lhwcv commented 2 years ago

@hirokic5 Almost the same with yours, I guess the high performance result reported in the official paper only include the network inference time.

hirokic5 commented 2 years ago

Thanks your reply ! I understood.

JinraeKim commented 2 years ago

@hirokic5 Almost the same with yours, I guess the high performance result reported in the official paper only include the network inference time.

It's also similar to me (even slower). What does "the inference time" mean? For only a single line, or a single execution of pred_lines?