Untitled

 avatar
unknown
plain_text
a year ago
11 kB
12
Indexable
def home_page():
    st.title("Guardian View : Real-Time Weapon Detection System")
    st.subheader("Enhancing Security Through AI-Powered Video Analysis")
    st.write("The authors : Dori rozen and Omer iny")
    st.write("Advisor: Mr. Rozewaks Yoram")
    st.image("PageLogo.jpeg", use_column_width=True)
def demo():
     st.markdown(
        """
        <style>
        .centered-title {
            font-size: 48px;
            font-weight: bold;
            color: #4A90E2;
            text-align: center;
            margin-top: 20%;
        }
        </style>
        <h1 class="centered-title">Let's Watch our system in action</h1>
        """,
        unsafe_allow_html=True,
    )
def welcome():
    st.title("Welcome to our final project presentation in software engineering !")
    st.write("""
    We've developed a cutting-edge weapon detection system that utilizes real-time video streaming
    and advanced AI techniques to enhance security in various environments.
    
    Our system addresses the critical need for rapid threat detection in public spaces, potentially 
    saving lives by providing early warnings to security personnel. By leveraging state-of-the-art 
    technologies, we've created a robust, scalable solution that can be deployed in diverse settings 
    such as schools, airports, and public events.
    """)

def why_this_project():
    videoPages(title="Why This Project ? ",videoPath="sideWalk.mp4")
def project_overview():
    st.title("Project Overview")
    st.write("""
    Our weapon detection system is designed to address the growing concern of public safety in an 
    increasingly unpredictable world. By harnessing the power of artificial intelligence and real-time 
    video analysis, we've created a tool that can significantly reduce response times in potential 
    threat situations.
    """)
    st.subheader("Core Components")
    st.markdown("""
    1. **YOLO (You Only Look Once) Model**: 
       - State-of-the-art object detection algorithm
       - Trained on a diverse dataset of weapon images
       - Capable of detecting multiple weapon types in real-time
    
    2. **Firebase Backend**:
       - Real-time database for instant data synchronization
       - Secure authentication system
       - Cloud storage for video streams and alert data
       - Push notification service for immediate threat alerts
    
    3. **Flutter Mobile Application**:
       - Cross-platform compatibility (iOS and Android)
       - Intuitive user interface for security personnel
       - Real-time alert system with threat details and location
       - Video playback of detected threats
    """)
def system_workflow():
    st.subheader("System Workflow")
    st.write("Guardian View is designed to enhance security in public spaces like malls and airports.")
    st.write("Key Features:")
    st.write("- Real-time threat detection")
    st.write("- User management")
    st.write("- Customizable alert thresholds")
    st.write("- Location-based alerting")

    st.write("""
    1. Video streams are captured from security cameras
    2. Frames are processed in real-time by the YOLO model
    3. Detected weapons trigger alerts in the Firebase backend
    4. Push notifications are sent to the mobile application
    5. Security personnel can view threat details and respond accordingly
    """)
def videoPages(title='',desc='',videoPath='',about=''):
    st.title(title)
    st.write(desc)
    st.video(videoPath)
    st.write(about)
def system_architecture():
    st.markdown(
    """
    <style>
    .stContainer {
        background-color: #f0f2f6;  /* Light background color */
        padding: 20px;
        border-radius: 10px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }
    .stTitle {
        color: #4A90E2;  /* Custom color for titles */
        text-align: center;
    }
    .stText {
        color: #333;
    }
    </style>
    """,
    unsafe_allow_html=True,
)
    with st.container():
        st.markdown('<div class="stContainer">', unsafe_allow_html=True)
        
        col1, col2 = st.columns([1, 2])
        with col1:
            st.write("Key Components")
            st.write("- AI Model: Custom-trained YOLOv8 for weapon detection")
            st.write("- Backend: Python server for video processing")
            st.write("- Frontend: Flutter mobile app")
            st.write("- Database: Firebase Firestore")
            st.write("- Storage: Firebase Storage")
            st.write("- Authentication: Firebase Auth")
        with col2:
            st.markdown('<h1 class="stTitle">System Architecture</h1>', unsafe_allow_html=True)
            st.image("architecture.jpg", caption="System Architecture Diagram")
        
        st.markdown('</div>', unsafe_allow_html=True)
    
    st.markdown('<div class="stContainer">', unsafe_allow_html=True)
    
    st.markdown('<h2 class="stTitle">AI Model</h2>', unsafe_allow_html=True)
    st.write("YOLOv8: Used for real-time weapon detection")
    st.write("Training: Custom training process and dataset used")
    st.write("Optimization: Steps taken to optimize the model for real-time performance")
    
    st.markdown('<h2 class="stTitle">Backend</h2>', unsafe_allow_html=True)
    st.write("Python Server: Role in video processing and threat detection")
    st.write("Event-Driven Architecture: Benefits for performance and scalability")
    
    st.markdown('<h2 class="stTitle">Frontend</h2>', unsafe_allow_html=True)
    st.write("Flutter Mobile App: Features and functionalities")
    st.write("User Interface: Key screens and user flow")
    st.write("Clean Architecture: Benefits and implementation challenges")
    
    
    st.markdown('<h2 class="stTitle">Database and Storage</h2>', unsafe_allow_html=True)
    st.write("Firebase Firestore: Data management and real-time updates")
    st.write("Firebase Storage: Storing video feeds and alerts")
    st.write("Authentication: User management and secure access")

    st.markdown('<h2 class="stTitle">Real-Time Alerts and Notifications</h2>', unsafe_allow_html=True)
    st.write("Alert System: How the system generates and sends real-time alerts")
    st.write("User Management: Customizable alert thresholds and location-based alerting")

    st.markdown('</div>', unsafe_allow_html=True)
def development_challenges():
    st.title("Development Challenges")
    st.subheader("Challenges Faced")
    st.write("- **Lack of live camera feeds**: Difficulty in accessing real-time camera data.")
    st.write("- **Lack of data to train the model**: Insufficient dataset for training an accurate model.")
    st.write("- **Event-driven architecture implementation**: Complexities in implementing an efficient event-driven architecture.")

    st.subheader("Solutions")
    st.write("""
    - **Training with limited data**: We managed to train the model using a relatively small dataset. To maximize training efficiency, we utilized Google Colab's GPU services.
    - **Simulating real-time feeds**: Due to the absence of connections to real security cameras, we simulated alerts by uploading videos or live streams from our computers. This allowed us to demonstrate the system's potential effectively.
    """)
def future_enhancements():
    # Inject custom CSS for styling the section
    st.markdown(
        """
        <style>
        .enhancements-container {
            background-color: #2e2e2e; /* Dark background color for better contrast */
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
        .enhancements-title {
            font-size: 32px;
            font-weight: bold;
            color: #4A90E2;
            text-align: center;
            margin-bottom: 20px;
        }
        .enhancements-item {
            font-size: 18px;
            color: #ffffff; /* White text color */
            margin-bottom: 10px;
        }
        </style>
        """,
        unsafe_allow_html=True,
    )

    # Content for the Future Enhancements section
    st.markdown('<div class="enhancements-container">', unsafe_allow_html=True)
    st.markdown('<h1 class="enhancements-title">Future Enhancements</h1>', unsafe_allow_html=True)
    
    st.markdown('<p class="enhancements-item">- Integration with live security camera feeds for real-time monitoring.</p>', unsafe_allow_html=True)
    st.markdown('<p class="enhancements-item">- Advanced analytics for improved threat detection and response.</p>', unsafe_allow_html=True)
    st.markdown('<p class="enhancements-item">- Additional features such as tracking the suspects so that the information will be updated to the security personnel and they will be able to navigate to it efficiently, and alert people in the immediate vicinity of possible dangers and increase vigilance.</p>', unsafe_allow_html=True)
    st.markdown('</div>', unsafe_allow_html=True)
def thank_you():
    st.markdown(
        """
        <style>
        .centered-title {
            font-size: 48px;
            font-weight: bold;
            color: #4A90E2;
            text-align: center;
            margin-top: 20%;
        }
        </style>
        <h1 class="centered-title">Thank You !</h1>
        """,
        unsafe_allow_html=True,
    )
#############################

def main():
    st.set_page_config(layout="wide",page_title="Guardian View Presentation",page_icon="🧊",)
    st.sidebar.title("Navigation")
    page = st.sidebar.radio("Go to", [
        "Welcome",
        "Home Page",
        "Why This Project",
        "Example 1",
        "Example 2",
        "Example 3",
        "Example 4",
        "Project Overview",
        "Development Challenges",
        "System Workflow",
        "System Architecture",
        "Demo",
        "Future Enhancements",
        "Thank You"
    ])

    if page == "Welcome":
        welcome()
    if page == "Home Page":
        home_page()
    elif page == "Why This Project":
        why_this_project() 
    elif page == "Example 1":
        videoPages(videoPath = "takingKnife.mp4")
    elif page == "Example 2":
        videoPages(videoPath = "nave1.mp4")
    elif page == "Example 3":
        videoPages(videoPath = "nave2.mp4")
    elif page == "Example 4":
        videoPages(videoPath="terrorInCarmiel.mp4")
    elif page == "Project Overview":
        project_overview()
    elif page == "Development Challenges":
        development_challenges()
    elif page == "System Workflow":
        system_workflow() 
    elif page == "System Architecture":
        system_architecture()
    elif page == "Demo":
        demo()
    elif page == "Future Enhancements":
        future_enhancements()
    elif page == "Thank You":
        thank_you()

if __name__ == "__main__":
    main()
Editor is loading...
Leave a Comment