hellochick / ICNet-tensorflow

TensorFlow-based implementation of "ICNet for Real-Time Semantic Segmentation on High-Resolution Images".
405 stars 153 forks source link

in demo.py why I test inference speed only 6 fps with titan xp #88

Closed zaibian closed 5 years ago

zaibian commented 5 years ago

hi,in demo.py why I test inference speed only 6 fps with titan xp?

hellochick commented 5 years ago

Could you please check your tensorflow version? Maybe you are using tensorflow instead of tensorflow-gpu, that is, you are not using gpu to accelerate.

zaibian commented 5 years ago

Thank you chick. Now I have another question. How can i realize real-time detection with my computer camera ? Because i coud not found the code for real-time detection by calling camera. Thankx!

hellochick commented 5 years ago

You can follow the instruction in demo.ipynb, and change cv2.imread into opencv VideoCapture to get input frames, something like this:

cap = cv2.VideoCapture(0)

while(True):
    # Capture frame-by-frame
    ret, frame = cap.read()

    # predict output
    output = net.predict(frame)

    cv2.imshow('frame', output)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
zaibian commented 5 years ago

thanks