-
Notifications
You must be signed in to change notification settings - Fork 4.2k
st.image() blinks sporadically in 0.59 #1454
Copy link
Copy link
Closed
Labels
type:bugSomething isn't working as expectedSomething isn't working as expected
Description
Summary
When displaying a stream of images in a st.empty(), the display "blinks" in 0.59 while it was running smoothly in 0.58.
Steps to reproduce
Here is a minimal example (just displaying what your camera sees)
import streamlit as st
import cv2
def main():
show = st.checkbox('Show image', False)
placeholder = st.empty()
if show:
vc = cv2.VideoCapture(0)
ret, frame = vc.read()
while ret:
placeholder.image(frame, channels='BGR')
ret, frame = vc.read()
vc.release()
if __name__ == "__main__":
main()It looks like the placeholder "empties itself" (:thinking:) between two displayed frames, even though it should keep the last frame until a new one is displayed.
I'm using streamlit installed via pip on Ubuntu 18.04
Is this a regression?
Yep, it worked perfectly in 0.58
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type:bugSomething isn't working as expectedSomething isn't working as expected