Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -354,20 +354,39 @@ with tab3: | |
| 354 |  | 
| 355 | 
             
                        col1, col2, col3 = st.columns([1, 3, 1])
         | 
| 356 |  | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 357 | 
             
                        with col2:
         | 
| 358 | 
            -
             | 
| 359 | 
             
                            image_width = 400
         | 
| 360 | 
            -
                             | 
| 361 | 
             
                            image_index = st.select_slider(
         | 
| 362 | 
             
                                "Choose an image",
         | 
| 363 | 
             
                                options=list(range(len(st.session_state['image_paths']))),
         | 
| 364 | 
             
                                format_func=lambda x: f"Image {x + 1}"
         | 
| 365 | 
             
                            )
         | 
| 366 | 
            -
             | 
| 367 |  | 
| 368 | 
             
                            # Button for actions related to the selected image
         | 
| 369 | 
             
                            if st.button("Details", key=f"details_{image_index}"):
         | 
| 370 | 
             
                                st.write(f"You clicked on image {image_index + 1}")
         | 
| 371 | 
             
                                # Add more actions for the click event here
         | 
| 372 |  | 
| 373 | 
            -
             | 
|  | |
| 354 |  | 
| 355 | 
             
                        col1, col2, col3 = st.columns([1, 3, 1])
         | 
| 356 |  | 
| 357 | 
            +
                     with col2:
         | 
| 358 | 
            +
                        # Initialize or update the image index
         | 
| 359 | 
            +
                        image_index = st.select_slider(
         | 
| 360 | 
            +
                            "Choose an image",
         | 
| 361 | 
            +
                            options=list(range(len(st.session_state['image_paths']))),
         | 
| 362 | 
            +
                            format_func=lambda x: f"Image {x + 1}"
         | 
| 363 | 
            +
                        )
         | 
| 364 | 
            +
                
         | 
| 365 | 
            +
                        # Display the selected image
         | 
| 366 | 
            +
                        st.image(st.session_state['image_paths'][image_index])
         | 
| 367 | 
            +
                
         | 
| 368 | 
            +
                        # Button for actions related to the selected image
         | 
| 369 | 
            +
                        if st.button("Details", key=f"details_{image_index}"):
         | 
| 370 | 
            +
                            st.write(f"You clicked on image {image_index + 1}")
         | 
| 371 | 
            +
             | 
| 372 | 
            +
             | 
| 373 | 
            +
             | 
| 374 | 
            +
                    
         | 
| 375 | 
            +
                        """
         | 
| 376 | 
             
                        with col2:
         | 
| 377 | 
            +
                            # Display the selected image
         | 
| 378 | 
             
                            image_width = 400
         | 
| 379 | 
            +
                            
         | 
| 380 | 
             
                            image_index = st.select_slider(
         | 
| 381 | 
             
                                "Choose an image",
         | 
| 382 | 
             
                                options=list(range(len(st.session_state['image_paths']))),
         | 
| 383 | 
             
                                format_func=lambda x: f"Image {x + 1}"
         | 
| 384 | 
             
                            )
         | 
| 385 | 
            +
                            st.image(st.session_state['image_paths'][image_index])
         | 
| 386 |  | 
| 387 | 
             
                            # Button for actions related to the selected image
         | 
| 388 | 
             
                            if st.button("Details", key=f"details_{image_index}"):
         | 
| 389 | 
             
                                st.write(f"You clicked on image {image_index + 1}")
         | 
| 390 | 
             
                                # Add more actions for the click event here
         | 
| 391 |  | 
| 392 | 
            +
                        """
         |