Subhash Vadaparthi commited on
Commit ·
7c966d6
1
Parent(s): a992812
fix: reduce stream flickering with slower interval and frame copy
Browse files32 unmodified lines33343536373888 unmodified lines12712812913013113213332 unmodified linesdef process_stream(frame, threshold, state):if frame is None:return frame, state, "No Frame Detected"# Ensure state is a dictionaryif not isinstance(state, dict):88 unmodified linesfn=process_stream,inputs=[input_img, threshold, app_state],outputs=[output_img, app_state, status_text],stream_every=0.05)if __name__ == "__main__":32 unmodified lines333435363738394088 unmodified lines12913013113213313413532 unmodified linesdef process_stream(frame, threshold, state):if frame is None:return frame, state, "No Frame Detected"frame = frame.copy()# Ensure state is a dictionaryif not isinstance(state, dict):88 unmodified linesfn=process_stream,inputs=[input_img, threshold, app_state],outputs=[output_img, app_state, status_text],stream_every=0.15)if __name__ == "__main__":
app.py+3-1