jaysaville / sync-streamlit

Consider removing the commented out code block PY-W0069
Anti-pattern
Major
9 occurrences in this check
Consider removing the commented out code block
166        with b:
167            show_vid = st.video(uploaded_video)
168        
169        # a, b, c = st.columns(3)170        # with a:
171        #     display_dial("FPS", f"{stats['fps']}", "#1C83E1")
172        # with b:
Consider removing the commented out code block
156
157        #Post request with video file
158        with st_lottie_spinner(lottie_model_loading):
159            # url = "https://syncv6-eagwezifvq-an.a.run.app/vid_stats"160            url = "http://127.0.0.1:8000/vid_stats"
161            files = {"file": (uploaded_video.name, uploaded_video, "multipart/form-data")}
162            stats = requests.post(url, files=files).json()
Consider removing the commented out code block
116    #Load processed video
117    video_url = response['output_url']
118    st.video(video_url)
119    # video_file = open('video.mp4', 'rb')120    # video_bytes = video_file.read()
121    # st.video(video_bytes)
122
Consider removing the commented out code block
 97
 98    st.write("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
 99    st.write('The following graph shows your average synchronisation error, smoothed for easier reference of intervals needing improvement or attention.')
100    # st.line_chart(data=df, x='Time', y='Smoothed Sync Error')101    fig2 = go.Figure()
102    fig2.add_trace(go.Scatter(x=df.index, y=list(df['Smoothed Sync Error'])))
103    fig2.update_layout(
Consider removing the commented out code block
 79    #Plot moving average graph
 80    st.write("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
 81    st.write('The following graph shows your absolute synchronisation error, calculated as a difference in pose/angle of major joints relative to each other. A lower value is a smaller difference, and therefore better synchronization. Peaks are areas of lowest synchronisation.')
 82    # st.line_chart(data=df, x='Time', y='Sync Error') 83    fig1 = go.Figure()
 84    fig1.add_trace(go.Scatter(x=df.index, y=list(df['Sync Error'])))
 85    fig1.update_layout(
Consider removing the commented out code block
 54def processing(stats):
 55    with st_lottie_spinner(lottie_model_loading, key='xd'):
 56        url = "http://127.0.0.1:8000/vid_process"
 57        # url = "https://syncv6-eagwezifvq-an.a.run.app/vid_process" 58        params = {
 59            "vid_name": stats['vid_name'],
 60            "output_name": stats['output_name'],
Consider removing the commented out code block
 51
 52@st.experimental_memo
 53def processing(d):
 54    # url = "http://127.0.0.1:8000/vid_process" 55    url = "https://syncv12-eagwezifvq-an.a.run.app/vid_process"
 56    params = {k:d[k] for k in d if k!='dim'}
 57    response = requests.get(url, params=params).json()
Consider removing the commented out code block
 61@st.experimental_memo
 62def fetch_stats(uploaded_video):
 63    url = "https://syncv12-eagwezifvq-an.a.run.app/vid_stats"
 64    # url = "http://127.0.0.1:8000/vid_stats" 65    files = {"file": (uploaded_video.name, uploaded_video, "multipart/form-data")}
 66    stats = requests.post(url, files=files).json()
 67    return stats
Consider removing the commented out code block
163                                           'Smoothed_error': 'Sync Error (degrees)'})
164            fig0.update_layout(hovermode="x unified")
165
166            # fig1 = create_fig('frames', 'good_scores', 'Model Inaccurracy',167            #                     'frames', {'frames': 'Frame Number', 
168            #                                'Smoothed_error': 'Mean Absolute Error'})
169            # fig1.update_traces(line_color="grey")