Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -67,9 +67,6 @@ if uploaded_file is not None: | |
| 67 | 
             
                # Load image
         | 
| 68 | 
             
                image = Image.open(uploaded_file)
         | 
| 69 |  | 
| 70 | 
            -
                # Display uploaded image
         | 
| 71 | 
            -
                st.image(image, caption="Uploaded Image", use_column_width=True)
         | 
| 72 | 
            -
             | 
| 73 | 
             
                # Detect license plates and characters
         | 
| 74 | 
             
                with st.spinner("Processing image..."):
         | 
| 75 | 
             
                    cropped_plates, original_image = detect_and_crop_license_plate(image)
         | 
| @@ -79,10 +76,10 @@ if uploaded_file is not None: | |
| 79 | 
             
                        for idx, cropped_image in enumerate(cropped_plates, 1):
         | 
| 80 | 
             
                            st.write(f"License Plate {idx}:")
         | 
| 81 | 
             
                            annotated_plate = detect_characters(cropped_image.copy())
         | 
| 82 | 
            -
                            st.image(cv2.cvtColor(annotated_plate, cv2.COLOR_BGR2RGB), caption=f"License Plate {idx} with Characters",  | 
| 83 | 
             
                    else:
         | 
| 84 | 
             
                        st.write("No license plates detected. Running character detection on the full image.")
         | 
| 85 | 
             
                        annotated_image = detect_characters(original_image.copy())
         | 
| 86 | 
            -
                        st.image(cv2.cvtColor(annotated_image, cv2.COLOR_BGR2RGB), caption="Full Image with Characters",  | 
| 87 |  | 
| 88 | 
             
                st.success("Processing complete!")
         | 
|  | |
| 67 | 
             
                # Load image
         | 
| 68 | 
             
                image = Image.open(uploaded_file)
         | 
| 69 |  | 
|  | |
|  | |
|  | |
| 70 | 
             
                # Detect license plates and characters
         | 
| 71 | 
             
                with st.spinner("Processing image..."):
         | 
| 72 | 
             
                    cropped_plates, original_image = detect_and_crop_license_plate(image)
         | 
|  | |
| 76 | 
             
                        for idx, cropped_image in enumerate(cropped_plates, 1):
         | 
| 77 | 
             
                            st.write(f"License Plate {idx}:")
         | 
| 78 | 
             
                            annotated_plate = detect_characters(cropped_image.copy())
         | 
| 79 | 
            +
                            st.image(cv2.cvtColor(annotated_plate, cv2.COLOR_BGR2RGB), caption=f"License Plate {idx} with Characters", use_container_width=True)
         | 
| 80 | 
             
                    else:
         | 
| 81 | 
             
                        st.write("No license plates detected. Running character detection on the full image.")
         | 
| 82 | 
             
                        annotated_image = detect_characters(original_image.copy())
         | 
| 83 | 
            +
                        st.image(cv2.cvtColor(annotated_image, cv2.COLOR_BGR2RGB), caption="Full Image with Characters", use_container_width=True)
         | 
| 84 |  | 
| 85 | 
             
                st.success("Processing complete!")
         | 
