Skip to content

st.image() blinks sporadically in 0.59 #1454

@nuayge

Description

@nuayge

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

Metadata

Metadata

Assignees

Labels

type:bugSomething isn't working as expected

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions